mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement response parser features, add request struct
This commit is contained in:
parent
0a7c3a6055
commit
a478e31bd5
2 changed files with 125 additions and 33 deletions
|
|
@ -96,13 +96,52 @@ namespace app::browser::main::tab
|
|||
|
||||
struct Gemini
|
||||
{
|
||||
// Defaults
|
||||
static const int DEFAULT_PORT = 1965;
|
||||
|
||||
// Actions
|
||||
static Glib::RefPtr<Gio::SocketClient> create();
|
||||
|
||||
static Glib::ustring get_request_from_uri(
|
||||
GUri * uri
|
||||
);
|
||||
struct Request
|
||||
{
|
||||
static Glib::ustring create_from_uri(
|
||||
GUri * uri
|
||||
);
|
||||
};
|
||||
|
||||
struct Response
|
||||
{
|
||||
/*
|
||||
* Status codes
|
||||
*
|
||||
* 10-19 Input expected
|
||||
* 20-29 Success
|
||||
* 30-39 Redirection
|
||||
* 40-49 Temporary failure
|
||||
* 50-59 Permanent failure
|
||||
* 60-69 Client certificates
|
||||
*
|
||||
* https://geminiprotocol.net/docs/protocol-specification.gmi#status-codes
|
||||
*/
|
||||
enum class Status
|
||||
{
|
||||
SUCCESS,
|
||||
REDIRECT,
|
||||
TEMPORARY_FAILURE,
|
||||
PERMANENT_FAILURE,
|
||||
CERTIFICATE,
|
||||
UNDEFINED
|
||||
}; // @TODO explain code groups
|
||||
|
||||
struct Match
|
||||
{
|
||||
static bool meta(
|
||||
const Glib::ustring & RESPONSE,
|
||||
Status & status,
|
||||
MIME & mime
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue