mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-10 16:54:16 +07:00
Adjusted docs and makefile to use correct preproc flags
This commit is contained in:
+11
-6
@@ -84,12 +84,12 @@ of the websocket frame which URI handler can examine. Note that to
|
||||
reply to the websocket client, `mg_websocket_write()` should be used.
|
||||
To reply to the plain HTTP client, `mg_write_data()` should be used.
|
||||
|
||||
An URI handler must return a value. If 0 is return, that signals Mongoose
|
||||
An URI handler must return a value. If URI handler has sent all data,
|
||||
it should return `1`. If URI handler returns `0`, that signals Mongoose
|
||||
that URI handler hasn't finished sending data to the client. In this case,
|
||||
Mongoose will call URI handler after each successful socket write.
|
||||
`struct mg_connection::wsbits` flag will indicate the status of the write,
|
||||
`1` means that write has failed and connection will be closed. If URI
|
||||
handler has sent all data, it should return `1`.
|
||||
`1` means that write has failed and connection will be closed.
|
||||
|
||||
void mg_set_http_error_handler(struct mg_server *, mg_handler_t);
|
||||
|
||||
@@ -141,7 +141,13 @@ a response body. Mongoose provides functions for all three parts:
|
||||
* `mg_send_data()` and `mg_printf_data()` are used to send data to the
|
||||
client. Note that Mongoose adds `Transfer-Encoding: chunked` header
|
||||
implicitly, and sends data in chunks. Therefore, it is not necessary to
|
||||
set `Content-Length` header.
|
||||
set `Content-Length` header. Note that `mg_send_data()` and
|
||||
`mg_printf_data()` do not send data immediately. Instead, they spool
|
||||
data in memory, and Mongoose sends that data later after URI handler
|
||||
returns. If data to be sent is huge, an URI handler might
|
||||
send data in pieces by saving state in
|
||||
`struct mg_connection::connection_param` variable and returning `0`. Then
|
||||
Mongoose will call a handler repeatedly after each socket write.
|
||||
|
||||
<!-- -->
|
||||
|
||||
@@ -149,8 +155,7 @@ a response body. Mongoose provides functions for all three parts:
|
||||
const char *data, size_t data_len);
|
||||
|
||||
Similar to `mg_write()`, but wraps the data into a websocket frame with a
|
||||
given websocket `opcode`. This function is available when mongoose is
|
||||
compiled with `-DUSE_WEBSOCKET`.
|
||||
given websocket `opcode`.
|
||||
|
||||
const char *mg_get_header(const struct mg_connection *, const char *name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user