HttpRequest
Description
Parsed HTTP request. Carries the allocator that owns url and headers; all sub-allocations route through the same handle.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Http.h:230:
Str url;
HttpHeaders headers;
} HttpRequest;
///
- In
Http.h:247:
#define HttpRequestInit_0() HttpRequestInit_1(MisraScope)
#define HttpRequestInit_1(alloc_ptr) \
((HttpRequest) {.allocator = ALLOCATOR_OF(alloc_ptr), \
.method = HTTP_REQUEST_METHOD_UNKNOWN, \
.url = StrInit_1(alloc_ptr), \- In
Http.h:280:
/// TAGS: Http, Request, Deinit, Init
///
void HttpRequestDeinit(HttpRequest *req);
///
- In
Http.c:108:
}
Zstr http_request_parse_zstr(HttpRequest *req, Zstr in) {
if (!req || !req->allocator || !in) {
LOG_FATAL("invalid arguments");- In
Http.c:177:
}
Zstr http_request_parse_str(HttpRequest *req, const Str *in) {
if (!req || !in) {
LOG_FATAL("invalid arguments");- In
Http.c:187:
}
void HttpRequestDeinit(HttpRequest *req) {
if (!req) {
LOG_FATAL("invalid arguments");- In
Beam.c:252:
StrPushBackMany(&raw, prefix_bytes);
HttpRequest req = HttpRequestInit(scope);
Zstr end = HttpRequestParse(&req, (Zstr)StrBegin(&raw));
if (end == StrBegin(&raw)) {- In
Http.Leak.c:90:
"\r\n";
HttpRequest req = HttpRequestInit(adbg);
Zstr next = HttpRequestParse(&req, raw);
bool ok = (next != raw) && (StrLen(&req.url) > 0);- In
Http.c:22:
"body-bytes";
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, raw);- In
Http.c:88:
bool ok = true;
for (u64 i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, cases[i].raw);
ok = ok && (next != cases[i].raw) && (req.method == cases[i].method);- In
Http.c:112:
bool ok = true;
for (u64 i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, cases[i]);
ok = ok && (next == cases[i]) && (req.method == HTTP_REQUEST_METHOD_UNKNOWN);- In
Http.c:135:
bool ok = true;
for (u64 i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, cases[i]);
ok = ok && (next == cases[i]) && (req.method == HTTP_REQUEST_METHOD_UNKNOWN);- In
Http.c:163:
StrAppendFmt(&raw, "\r\n");
HttpRequest req = HttpRequestInit(alloc_base);
Zstr in = StrBegin(&raw);
Zstr next = HttpRequestParse(&req, in);- In
Http.c:190:
StrAppendFmt(&raw, "\r\n");
HttpRequest req = HttpRequestInit(alloc_base);
Zstr in = StrBegin(&raw);
Zstr next = HttpRequestParse(&req, in);
Last updated on