I am talking about the method, url, and http-version.
I want a struct that looks like this:
struct http_rq {
char method[?];
char url[?];
char version[?];
}
But I don't know how big each value "can" be.
I am talking about the method, url, and http-version.
I want a struct that looks like this:
struct http_rq {
char method[?];
char url[?];
char version[?];
}
But I don't know how big each value "can" be.
Reading https://www.rfc-editor.org/rfc/rfc9110.html#name-methods the longest method is CONNECT
and OPTIONS
which is 7 bytes.
I do not see any limit on url
, so I believe infinity.
Although HTTP's version number consists of two decimal digits separated by a "."
I do not see any limitation on the digits. So I would say that version is also a potentially infinite string.
Overall, I would make method an enum
, make url
dynamically allocated string and I would replace version
by two integers.