Skip to content
HttpRequestDeinit

HttpRequestDeinit

Description

Release storage owned by req and zero the struct. Safe to call on a partially-parsed request.

Success

Returns to the caller. *req is zeroed.

Failure

Aborts via LOG_FATAL when req is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    void HttpRequestDeinit(HttpRequest *req) {
        if (!req) {
            LOG_FATAL("invalid arguments");
                LOG_INFO("[{}] {} {}", client_addr, method, req.url);
            }
            HttpRequestDeinit(&req);
            StrDeinit(&raw);
        }
        ok               = ok && (DebugAllocatorLiveCount(&dbg) > 0);
    
        HttpRequestDeinit(&req);
        ok = ok && (DebugAllocatorLiveCount(&dbg) == 0);
        ok               = ok && host && ZstrCompare(StrBegin(&host->value), "example.com") == 0;
    
        HttpRequestDeinit(&req);
        DefaultAllocatorDeinit(&alloc);
        return ok;
            Zstr        next = HttpRequestParse(&req, cases[i].raw);
            ok               = ok && (next != cases[i].raw) && (req.method == cases[i].method);
            HttpRequestDeinit(&req);
        }
            Zstr        next = HttpRequestParse(&req, cases[i]);
            ok               = ok && (next == cases[i]) && (req.method == HTTP_REQUEST_METHOD_UNKNOWN);
            HttpRequestDeinit(&req);
        }
            Zstr        next = HttpRequestParse(&req, cases[i]);
            ok               = ok && (next == cases[i]) && (req.method == HTTP_REQUEST_METHOD_UNKNOWN);
            HttpRequestDeinit(&req);
        }
        bool ok = (next == in);
    
        HttpRequestDeinit(&req);
        StrDeinit(&raw);
        DefaultAllocatorDeinit(&alloc);
        bool ok = (next != in) && (VecLen(&req.headers) == 100);
    
        HttpRequestDeinit(&req);
        StrDeinit(&raw);
        DefaultAllocatorDeinit(&alloc);
Last updated on