AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch_rest_nginx.h File Reference
#include <stddef.h>
Include dependency graph for anch_rest_nginx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  anch_rest_str_t
struct  anch_rest_header_t
struct  anch_rest_body_reader_t
struct  anch_rest_request_t
struct  anch_rest_response_writer_t
struct  anch_rest_application_t

Macros

#define ANCH_REST_NGINX_ABI_VERSION   2u
#define ANCH_REST_APPLICATION_SYMBOL   "anch_rest_application"
#define ANCH_REST_READ_ERROR   ((size_t) -1)
#define ANCH_REST_UNKNOWN_LENGTH   (-1LL)

Typedefs

typedef const anch_rest_application_t *(*) anch_rest_application_fn(void)

Detailed Description

AnCH REST nginx module C ABI.
An application is a shared library which exports anch_rest_application (see ANCH_REST_APPLICATION in rest/nginxApplication.hpp ). The nginx module loads it with dlopen , creates one application per worker process, and calls handle from nginx thread pool threads (or from the event loop when thread pool is disabled).

Request and response bodies are streamed: the application reads the request body with anch_rest_body_reader_t and writes the response with anch_rest_response_writer_t . In a thread pool, these functions block until nginx has received or sent data.

Macro Definition Documentation

◆ ANCH_REST_APPLICATION_SYMBOL

#define ANCH_REST_APPLICATION_SYMBOL   "anch_rest_application"

Application entry point symbol

◆ ANCH_REST_NGINX_ABI_VERSION

#define ANCH_REST_NGINX_ABI_VERSION   2u

ABI version: the module refuses applications with another version

◆ ANCH_REST_READ_ERROR

#define ANCH_REST_READ_ERROR   ((size_t) -1)

Error returned by anch_rest_body_reader_t read function

◆ ANCH_REST_UNKNOWN_LENGTH

#define ANCH_REST_UNKNOWN_LENGTH   (-1LL)

Unknown response content length (body is sent with chunked transfer encoding)

Typedef Documentation

◆ anch_rest_application_fn

typedef const anch_rest_application_t *(*) anch_rest_application_fn(void)

Application entry point type