HTTP_ALLOC(3)

NAME
http_alloc - allocate a HTTP context object

SYNOPSIS

#include <slweb/http.h>

struct http *http_alloc(const struct http_cfg *cfg);

DESCRIPTION
The http_alloc(3) function allocates a struct http_ctx object, containing the required data by slweb to handle a HTTP connection. This object is meant to be consumed by other functions from slweb. cfg defines the configuration for the HTTP context, whose structure is defined by slweb_http(7). struct http_ctx is an opaque object internal to slweb and therefore is not accessible to callers.

RETURN VALUE
On success, an opaque pointer to a struct http_ctx object is returned. On error, a null pointer is returned, and errno might be set by the internal call to malloc(3).

ERRORS
Refer to malloc(3) for a list of possible errors.

NOTES
This function is designed for internal use by slweb.

SEE ALSO
http_free(3), http_update(3), slweb_http(7).

COPYRIGHT
Copyright (C) 2023 Xavier Del Campo Romero.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.