AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch_rest_application_t Struct Reference

#include <anch_rest_nginx.h>

Collaboration diagram for anch_rest_application_t:

Public Attributes

unsigned int abi_version
void *(*) create (const char *config, char *error, size_t error_size)
void(*) destroy (void *app)
int(*) handle (void *app, const anch_rest_request_t *request, const anch_rest_response_writer_t *writer)

Detailed Description

Application operations

Member Data Documentation

◆ abi_version

unsigned int anch_rest_application_t::abi_version

◆ create

void *(*) anch_rest_application_t::create(const char *config, char *error, size_t error_size)

Create application (called once in each worker process)

Parameters
configthe configuration string (second anch_rest_app argument, empty when not set)
errorthe buffer for error message
error_sizethe error buffer size
Returns
the application, NULL on error

◆ destroy

void(*) anch_rest_application_t::destroy(void *app)

Destroy application

Parameters
appthe application

◆ handle

int(*) anch_rest_application_t::handle(void *app, const anch_rest_request_t *request, const anch_rest_response_writer_t *writer)

Handle request (thread safe). The response is started with writer->start , then its body is written with writer->write . Errors before start are answered with status 500 by the application.

Parameters
appthe application
requestthe request
writerthe response writer
Returns
0 when response is complete, -1 when response has been interrupted after its start (the connection has to be closed) ; a response which has not been started is answered with 500

The documentation for this struct was generated from the following file: