#include <anch_rest_nginx.h>
Response writer: valid during handle call
◆ buffer_size
| size_t anch_rest_response_writer_t::buffer_size |
Preferred size of written blocks (size of module buffers)
◆ ctx
| void* anch_rest_response_writer_t::ctx |
◆ start
| int(*) anch_rest_response_writer_t::start(void *ctx, unsigned int status, const anch_rest_header_t *headers, size_t headers_count, long long content_length) |
Start response: send status and headers. It has to be called once, before write . Memory is copied by the module: it can be released after the call.
- Parameters
-
| ctx | the writer context |
| status | the status code |
| headers | the headers (Content-Length is ignored) |
| headers_count | the number of headers |
| content_length | the body length, ANCH_REST_UNKNOWN_LENGTH when unknown |
- Returns
0 on success, -1 when response has been cancelled (client closed connection, ...)
◆ write
| size_t(*) anch_rest_response_writer_t::write(void *ctx, const char *data, size_t len) |
Write body data: blocks while module buffers are full (client is slower than application)
- Parameters
-
| ctx | the writer context |
| data | the data |
| len | the data length |
- Returns
- the number of written bytes (at least
1 ), 0 when response has been cancelled
The documentation for this struct was generated from the following file: