From 9101cd0339a44afcb1a4358ace0a689b211f6943 Mon Sep 17 00:00:00 2001 From: Alexander Alashkin Date: Fri, 22 Jul 2016 17:08:14 +0100 Subject: [PATCH] Use lld for ID PUBLISHED_FROM=1246247fc29eb9a75b986ff7bb2d2350a52c03fc --- docs/c-api/http.h/mg_connect_http.md | 8 ++-- docs/c-api/http.h/mg_connect_http_opt.md | 6 +-- docs/c-api/http.h/mg_connect_ws.md | 2 +- docs/c-api/http.h/mg_connect_ws_opt.md | 4 +- docs/c-api/http.h/mg_file_upload_handler.md | 2 +- docs/c-api/http.h/mg_get_http_header.md | 2 +- docs/c-api/http.h/mg_get_http_var.md | 6 +-- .../c-api/http.h/mg_http_check_digest_auth.md | 2 +- .../mg_http_create_digest_auth_header.md | 2 +- docs/c-api/http.h/mg_http_parse_header.md | 8 ++-- docs/c-api/http.h/mg_parse_http.md | 8 ++-- docs/c-api/http.h/mg_parse_multipart.md | 6 +-- docs/c-api/http.h/mg_printf_html_escape.md | 2 +- docs/c-api/http.h/mg_printf_http_chunk.md | 2 +- .../c-api/http.h/mg_printf_websocket_frame.md | 4 +- .../c-api/http.h/mg_register_http_endpoint.md | 4 +- docs/c-api/http.h/mg_send_head.md | 8 ++-- docs/c-api/http.h/mg_send_http_chunk.md | 12 +++--- docs/c-api/http.h/mg_send_response_line.md | 2 +- docs/c-api/http.h/mg_send_websocket_frame.md | 4 +- docs/c-api/http.h/mg_send_websocket_framev.md | 2 +- .../http.h/mg_send_websocket_handshake.md | 8 ++-- .../http.h/mg_send_websocket_handshake2.md | 8 ++-- docs/c-api/http.h/mg_serve_http.md | 2 +- .../http.h/mg_set_protocol_http_websocket.md | 41 ++++++++++--------- docs/c-api/http.h/mg_url_decode.md | 4 +- 26 files changed, 80 insertions(+), 79 deletions(-) diff --git a/docs/c-api/http.h/mg_connect_http.md b/docs/c-api/http.h/mg_connect_http.md index 83d01a6c..b897be0c 100644 --- a/docs/c-api/http.h/mg_connect_http.md +++ b/docs/c-api/http.h/mg_connect_http.md @@ -10,13 +10,13 @@ signature: | const char *post_data); --- -Helper function that creates an outbound HTTP connection. +Helper function that creates outbound HTTP connection. `url` is a URL to fetch. It must be properly URL-encoded, e.g. have -no spaces, etc. By default, `mg_connect_http()` sends the Connection and -Host headers. `extra_headers` is an extra HTTP header to send, e.g. +no spaces, etc. By default, `mg_connect_http()` sends Connection and +Host headers. `extra_headers` is an extra HTTP headers to send, e.g. `"User-Agent: my-app\r\n"`. -If `post_data` is NULL, then a GET request is created. Otherwise, a POST request +If `post_data` is NULL, then GET request is created. Otherwise, POST request is created with the specified POST data. Note that if the data being posted is a form submission, the `Content-Type` header should be set accordingly (see example below). diff --git a/docs/c-api/http.h/mg_connect_http_opt.md b/docs/c-api/http.h/mg_connect_http_opt.md index 711573e7..be68a67f 100644 --- a/docs/c-api/http.h/mg_connect_http_opt.md +++ b/docs/c-api/http.h/mg_connect_http_opt.md @@ -11,8 +11,8 @@ signature: | const char *post_data); --- -Helper function that creates an outbound HTTP connection. +Helper function that creates outbound HTTP connection. -Mostly identical to mg_connect_http, but allows you to provide extra parameters -(for example, SSL parameters) +Mostly identical to mg_connect_http, but allows to provide extra parameters +(for example, SSL parameters diff --git a/docs/c-api/http.h/mg_connect_ws.md b/docs/c-api/http.h/mg_connect_ws.md index b0f38d74..417279c8 100644 --- a/docs/c-api/http.h/mg_connect_ws.md +++ b/docs/c-api/http.h/mg_connect_ws.md @@ -13,7 +13,7 @@ Helper function that creates an outbound WebSocket connection. `url` is a URL to connect to. It must be properly URL-encoded, e.g. have no spaces, etc. By default, `mg_connect_ws()` sends Connection and -Host headers. `extra_headers` is an extra HTTP header to send, e.g. +Host headers. `extra_headers` is an extra HTTP headers to send, e.g. `"User-Agent: my-app\r\n"`. If `protocol` is not NULL, then a `Sec-WebSocket-Protocol` header is sent. diff --git a/docs/c-api/http.h/mg_connect_ws_opt.md b/docs/c-api/http.h/mg_connect_ws_opt.md index 57956ddb..3ab91083 100644 --- a/docs/c-api/http.h/mg_connect_ws_opt.md +++ b/docs/c-api/http.h/mg_connect_ws_opt.md @@ -12,6 +12,6 @@ signature: | Helper function that creates an outbound WebSocket connection -Mostly identical to `mg_connect_ws`, but allows to provide extra parameters -(for example, SSL parameters) +Mostly identical to mg_connect_ws, but allows to provide extra parameters +(for example, SSL parameters diff --git a/docs/c-api/http.h/mg_file_upload_handler.md b/docs/c-api/http.h/mg_file_upload_handler.md index e785f4ec..b0459676 100644 --- a/docs/c-api/http.h/mg_file_upload_handler.md +++ b/docs/c-api/http.h/mg_file_upload_handler.md @@ -12,7 +12,7 @@ This handler can be used to implement file uploads with minimum code. This handler will process MG_EV_HTTP_PART_* events and store file data into a local file. `local_name_fn` will be invoked with whatever name was provided by the client -and will expect the name of the local file to open. A return value of NULL will +and will expect the name of the local file to open. Return value of NULL will abort file upload (client will get a "403 Forbidden" response). If non-null, the returned string must be heap-allocated and will be freed by the caller. Exception: it is ok to return the same string verbatim. diff --git a/docs/c-api/http.h/mg_get_http_header.md b/docs/c-api/http.h/mg_get_http_header.md index b33e91f4..5c6d85ba 100644 --- a/docs/c-api/http.h/mg_get_http_header.md +++ b/docs/c-api/http.h/mg_get_http_header.md @@ -6,7 +6,7 @@ signature: | struct mg_str *mg_get_http_header(struct http_message *hm, const char *name); --- -Searches and returns the header `name` in parsed HTTP message `hm`. +Search and return header `name` in parsed HTTP message `hm`. If header is not found, NULL is returned. Example: struct mg_str *host_hdr = mg_get_http_header(hm, "Host"); diff --git a/docs/c-api/http.h/mg_get_http_var.md b/docs/c-api/http.h/mg_get_http_var.md index 6f718225..cc54c2eb 100644 --- a/docs/c-api/http.h/mg_get_http_var.md +++ b/docs/c-api/http.h/mg_get_http_var.md @@ -7,10 +7,10 @@ signature: | size_t dst_len); --- -Fetches a HTTP form variable. +Fetch an HTTP form variable. -Fetches a variable `name` from a `buf` into a buffer specified by -`dst`, `dst_len`. The destination is always zero-terminated. Returns the length +Fetch a variable `name` from a `buf` into a buffer specified by +`dst`, `dst_len`. Destination is always zero-terminated. Return length of a fetched variable. If not found, 0 is returned. `buf` must be valid url-encoded buffer. If destination is too small, `-1` is returned. diff --git a/docs/c-api/http.h/mg_http_check_digest_auth.md b/docs/c-api/http.h/mg_http_check_digest_auth.md index 3494eb26..99cb66d7 100644 --- a/docs/c-api/http.h/mg_http_check_digest_auth.md +++ b/docs/c-api/http.h/mg_http_check_digest_auth.md @@ -7,6 +7,6 @@ signature: | FILE *fp); --- -Authenticates a HTTP request against an opened password file. +Authenticate HTTP request against opened passwords file. Returns 1 if authenticated, 0 otherwise. diff --git a/docs/c-api/http.h/mg_http_create_digest_auth_header.md b/docs/c-api/http.h/mg_http_create_digest_auth_header.md index 67b2eab8..dd98fdc1 100644 --- a/docs/c-api/http.h/mg_http_create_digest_auth_header.md +++ b/docs/c-api/http.h/mg_http_create_digest_auth_header.md @@ -9,5 +9,5 @@ signature: | const char *passwd); --- -Creates digest authentication header for a client request. +Create Digest authentication header for client request. diff --git a/docs/c-api/http.h/mg_http_parse_header.md b/docs/c-api/http.h/mg_http_parse_header.md index c6fbae6a..cd7beb6e 100644 --- a/docs/c-api/http.h/mg_http_parse_header.md +++ b/docs/c-api/http.h/mg_http_parse_header.md @@ -7,17 +7,17 @@ signature: | size_t buf_size); --- -Parses the HTTP header `hdr`. Finds variable `var_name` and stores its value -in the buffer `buf`, `buf_size`. Returns 0 if variable not found, non-zero +Parse HTTP header `hdr`. Find variable `var_name` and store it's value +in the buffer `buf`, `buf_size`. Return 0 if variable not found, non-zero otherwise. This function is supposed to parse -cookies, authentication headers, etc. Example (error handling omitted): +cookies, authentication headers, etcetera. Example (error handling omitted): char user[20]; struct mg_str *hdr = mg_get_http_header(hm, "Authorization"); mg_http_parse_header(hdr, "username", user, sizeof(user)); -Returns the length of the variable's value. If buffer is not large enough, +Return length of the variable's value. If buffer is not large enough, or variable not found, 0 is returned. diff --git a/docs/c-api/http.h/mg_parse_http.md b/docs/c-api/http.h/mg_parse_http.md index fdd5c638..068ddc16 100644 --- a/docs/c-api/http.h/mg_parse_http.md +++ b/docs/c-api/http.h/mg_parse_http.md @@ -6,10 +6,10 @@ signature: | int mg_parse_http(const char *s, int n, struct http_message *hm, int is_req); --- -Parses a HTTP message. +Parse a HTTP message. -`is_req` should be set to 1 if parsing a request, 0 if reply. +`is_req` should be set to 1 if parsing request, 0 if reply. -Returns the number of bytes parsed. If HTTP message is -incomplete `0` is returned. On parse error, a negative number is returned. +Return number of bytes parsed. If HTTP message is +incomplete, `0` is returned. On parse error, negative number is returned. diff --git a/docs/c-api/http.h/mg_parse_multipart.md b/docs/c-api/http.h/mg_parse_multipart.md index f98d48fa..3eb82cdb 100644 --- a/docs/c-api/http.h/mg_parse_multipart.md +++ b/docs/c-api/http.h/mg_parse_multipart.md @@ -9,13 +9,13 @@ signature: | size_t *chunk_len); --- -Parses the buffer `buf`, `buf_len` that contains multipart form data chunks. -Stores the chunk name in a `var_name`, `var_name_len` buffer. +Parse buffer `buf`, `buf_len` that contains multipart form data chunks. +Store chunk name in a `var_name`, `var_name_len` buffer. If a chunk is an uploaded file, then `file_name`, `file_name_len` is filled with an uploaded file name. `chunk`, `chunk_len` points to the chunk data. -Return: number of bytes to skip to the next chunk or 0 if there are +Return: number of bytes to skip to the next chunk, or 0 if there are no more chunks. Usage example: diff --git a/docs/c-api/http.h/mg_printf_html_escape.md b/docs/c-api/http.h/mg_printf_html_escape.md index 6238e28d..fd1ff3e0 100644 --- a/docs/c-api/http.h/mg_printf_html_escape.md +++ b/docs/c-api/http.h/mg_printf_html_escape.md @@ -6,5 +6,5 @@ signature: | void mg_printf_html_escape(struct mg_connection *nc, const char *fmt, ...); --- -Sends a printf-formatted HTTP chunk, escaping HTML tags. +Send printf-formatted HTTP chunk, escaping HTML tags. diff --git a/docs/c-api/http.h/mg_printf_http_chunk.md b/docs/c-api/http.h/mg_printf_http_chunk.md index f99324b2..a8e6d142 100644 --- a/docs/c-api/http.h/mg_printf_http_chunk.md +++ b/docs/c-api/http.h/mg_printf_http_chunk.md @@ -6,6 +6,6 @@ signature: | void mg_printf_http_chunk(struct mg_connection *nc, const char *fmt, ...); --- -Sends a printf-formatted HTTP chunk. +Send printf-formatted HTTP chunk. Functionality is similar to `mg_send_http_chunk()`. diff --git a/docs/c-api/http.h/mg_printf_websocket_frame.md b/docs/c-api/http.h/mg_printf_websocket_frame.md index a7e8944b..a6561299 100644 --- a/docs/c-api/http.h/mg_printf_websocket_frame.md +++ b/docs/c-api/http.h/mg_printf_websocket_frame.md @@ -7,8 +7,8 @@ signature: | const char *fmt, ...); --- -Sends WebSocket frame to the remote end. +Send websocket frame to the remote end. -Like `mg_send_websocket_frame()`, but allows to create formatted messages +Like `mg_send_websocket_frame()`, but allows to create formatted message with `printf()`-like semantics. diff --git a/docs/c-api/http.h/mg_register_http_endpoint.md b/docs/c-api/http.h/mg_register_http_endpoint.md index 752eaae6..eefbe99e 100644 --- a/docs/c-api/http.h/mg_register_http_endpoint.md +++ b/docs/c-api/http.h/mg_register_http_endpoint.md @@ -7,8 +7,8 @@ signature: | mg_event_handler_t handler); --- -Registers a callback for a specified http endpoint -Note: if callback is registered it is called instead of the +Register callback for specified http endpoint +Note: if callback is registered it is called instead of callback provided in mg_bind Example code snippet: diff --git a/docs/c-api/http.h/mg_send_head.md b/docs/c-api/http.h/mg_send_head.md index 698c8cd8..cd18d36c 100644 --- a/docs/c-api/http.h/mg_send_head.md +++ b/docs/c-api/http.h/mg_send_head.md @@ -7,15 +7,15 @@ signature: | int64_t content_length, const char *extra_headers); --- -Sends a response line and headers. -This function sends a response line with the `status_code`, and automatically -sends one header: either "Content-Length" or "Transfer-Encoding". +Send response line and headers. +This function sends response line with the `status_code`, and automatically +sends one header: either "Content-Length", or "Transfer-Encoding". If `content_length` is negative, then "Transfer-Encoding: chunked" header is sent, otherwise, "Content-Length" header is sent. NOTE: If `Transfer-Encoding` is `chunked`, then message body must be sent using `mg_send_http_chunk()` or `mg_printf_http_chunk()` functions. Otherwise, `mg_send()` or `mg_printf()` must be used. -Extra headers could be set through `extra_headers`. Note `extra_headers` +Extra headers could be set through `extra_headers` - and note `extra_headers` must NOT be terminated by a new line. diff --git a/docs/c-api/http.h/mg_send_http_chunk.md b/docs/c-api/http.h/mg_send_http_chunk.md index b78dae6b..6d017fbb 100644 --- a/docs/c-api/http.h/mg_send_http_chunk.md +++ b/docs/c-api/http.h/mg_send_http_chunk.md @@ -6,16 +6,16 @@ signature: | void mg_send_http_chunk(struct mg_connection *nc, const char *buf, size_t len); --- -Sends buffer `buf` of size `len` to the client using chunked HTTP encoding. -This function sends the buffer size as hex number + newline first, then -the buffer itself, then the newline. For example, - `mg_send_http_chunk(nc, "foo", 3)` whill append the `3\r\nfoo\r\n` string to +Send buffer `buf` of size `len` to the client using chunked HTTP encoding. +This function first sends buffer size as hex number + newline, then +buffer itself, then newline. For example, + `mg_send_http_chunk(nc, "foo", 3)` whill append `3\r\nfoo\r\n` string to the `nc->send_mbuf` output IO buffer. -NOTE: The HTTP header "Transfer-Encoding: chunked" should be sent prior to +NOTE: HTTP header "Transfer-Encoding: chunked" should be sent prior to using this function. -NOTE: do not forget to send an empty chunk at the end of the response, +NOTE: do not forget to send empty chunk at the end of the response, to tell the client that everything was sent. Example: ``` diff --git a/docs/c-api/http.h/mg_send_response_line.md b/docs/c-api/http.h/mg_send_response_line.md index bd72b0da..8f62d717 100644 --- a/docs/c-api/http.h/mg_send_response_line.md +++ b/docs/c-api/http.h/mg_send_response_line.md @@ -7,7 +7,7 @@ signature: | const char *extra_headers); --- -Sends a response status line. +Send response status line. If `extra_headers` is not NULL, then `extra_headers` are also sent after the reponse line. `extra_headers` must NOT end end with new line. Example: diff --git a/docs/c-api/http.h/mg_send_websocket_frame.md b/docs/c-api/http.h/mg_send_websocket_frame.md index 8a407a68..bcc5d0c5 100644 --- a/docs/c-api/http.h/mg_send_websocket_frame.md +++ b/docs/c-api/http.h/mg_send_websocket_frame.md @@ -7,9 +7,9 @@ signature: | const void *data, size_t data_len); --- -Send WebSocket frame to the remote end. +Send websocket frame to the remote end. -`op_and_flags` specifies the frame's type. It's one of: +`op_and_flags` specifies frame's type, one of: - WEBSOCKET_OP_CONTINUE - WEBSOCKET_OP_TEXT diff --git a/docs/c-api/http.h/mg_send_websocket_framev.md b/docs/c-api/http.h/mg_send_websocket_framev.md index 89258bd8..4eb3709f 100644 --- a/docs/c-api/http.h/mg_send_websocket_framev.md +++ b/docs/c-api/http.h/mg_send_websocket_framev.md @@ -7,7 +7,7 @@ signature: | const struct mg_str *strings, int num_strings); --- -Sends multiple WebSocket frames. +Send multiple websocket frames. Like `mg_send_websocket_frame()`, but composes a frame from multiple buffers. diff --git a/docs/c-api/http.h/mg_send_websocket_handshake.md b/docs/c-api/http.h/mg_send_websocket_handshake.md index 124807a4..20ee7017 100644 --- a/docs/c-api/http.h/mg_send_websocket_handshake.md +++ b/docs/c-api/http.h/mg_send_websocket_handshake.md @@ -7,14 +7,14 @@ signature: | const char *extra_headers); --- -Sends WebSocket handshake to the server. +Send websocket handshake to the server. `nc` must be a valid connection, connected to a server. `uri` is an URI -to fetch, `extra_headers` are extra HTTP headers to send or `NULL`. +to fetch, extra_headers` is extra HTTP headers to send or `NULL`. -This function is intended to be used by the WebSocket client. +This function is intended to be used by websocket client. -Note that the host header is mandatory in HTTP/1.1 and must be +Note that the Host header is mandatory in HTTP/1.1 and must be included in `extra_headers`. `mg_send_websocket_handshake2` offers a better API for that. diff --git a/docs/c-api/http.h/mg_send_websocket_handshake2.md b/docs/c-api/http.h/mg_send_websocket_handshake2.md index a297d0c6..27c5c3b8 100644 --- a/docs/c-api/http.h/mg_send_websocket_handshake2.md +++ b/docs/c-api/http.h/mg_send_websocket_handshake2.md @@ -8,12 +8,12 @@ signature: | const char *extra_headers); --- -Send WebSocket handshake to the server. +Send websocket handshake to the server. `nc` must be a valid connection, connected to a server. `uri` is an URI to fetch, `host` goes into the `Host` header, `protocol` goes into the -`Sec-WebSocket-Proto` header (NULL to omit), `extra_headers` is an extra HTTP -header to send or `NULL`. +`Sec-WebSocket-Proto` header (NULL to omit), extra_headers` is extra HTTP +headers to send or `NULL`. -This function is intended to be used by the WebSocket client. +This function is intended to be used by websocket client. diff --git a/docs/c-api/http.h/mg_serve_http.md b/docs/c-api/http.h/mg_serve_http.md index 98069503..22b32688 100644 --- a/docs/c-api/http.h/mg_serve_http.md +++ b/docs/c-api/http.h/mg_serve_http.md @@ -7,7 +7,7 @@ signature: | struct mg_serve_http_opts opts); --- -Serves given HTTP request according to the `options`. +Serve given HTTP request according to the `options`. Example code snippet: diff --git a/docs/c-api/http.h/mg_set_protocol_http_websocket.md b/docs/c-api/http.h/mg_set_protocol_http_websocket.md index bc806312..9dcefcba 100644 --- a/docs/c-api/http.h/mg_set_protocol_http_websocket.md +++ b/docs/c-api/http.h/mg_set_protocol_http_websocket.md @@ -6,42 +6,43 @@ signature: | void mg_set_protocol_http_websocket(struct mg_connection *nc); --- -Attach a built-in HTTP event handler to a given connection. -The user-defined event handler will receive the following extra events: +Attach built-in HTTP event handler to the given connection. +User-defined event handler will receive following extra events: - MG_EV_HTTP_REQUEST: HTTP request has arrived. Parsed HTTP request is passed as `struct http_message` through the handler's `void *ev_data` pointer. -- MG_EV_HTTP_MULTIPART_REQUEST: A multipart POST request has been received. - This event is sent before the body is parsed. After this the user +- MG_EV_HTTP_MULTIPART_REQUEST: A multipart POST request has received. + This event is sent before body is parsed. After this user should expect a sequence of MG_EV_HTTP_PART_BEGIN/DATA/END requests. This is also the last time when headers and other request fields are accessible. -- MG_EV_HTTP_REPLY: HTTP reply has arrived. The parsed HTTP reply is passed as +- MG_EV_HTTP_REPLY: HTTP reply has arrived. Parsed HTTP reply is passed as `struct http_message` through the handler's `void *ev_data` pointer. - MG_EV_HTTP_CHUNK: HTTP chunked-encoding chunk has arrived. - The parsed HTTP reply is passed as `struct http_message` through the + Parsed HTTP reply is passed as `struct http_message` through the handler's `void *ev_data` pointer. `http_message::body` would contain incomplete, reassembled HTTP body. - It will grow with every new chunk arrived and could - potentially consume a lot of memory. An event handler may process - the body as chunks are coming in, and signal Mongoose to delete processed + It will grow with every new chunk arrived, and + potentially can consume a lot of memory. An event handler may process + the body as chunks are coming, and signal Mongoose to delete processed body by setting `MG_F_DELETE_CHUNK` in `mg_connection::flags`. When the last zero chunk is received, - Mongoose sends an `MG_EV_HTTP_REPLY` event with - the full reassembled body (if handler did not signal to delete chunks) or - with the empty body (if handler did signal to delete chunks). -- MG_EV_WEBSOCKET_HANDSHAKE_REQUEST: server has received WebSocket handshake + Mongoose sends `MG_EV_HTTP_REPLY` event with + full reassembled body (if handler did not signal to delete chunks) or + with empty body (if handler did signal to delete chunks). +- MG_EV_WEBSOCKET_HANDSHAKE_REQUEST: server has received websocket handshake request. `ev_data` contains parsed HTTP request. -- MG_EV_WEBSOCKET_HANDSHAKE_DONE: server has completed WebSocket handshake. +- MG_EV_WEBSOCKET_HANDSHAKE_DONE: server has completed Websocket handshake. `ev_data` is `NULL`. -- MG_EV_WEBSOCKET_FRAME: new WebSocket frame has arrived. `ev_data` is +- MG_EV_WEBSOCKET_FRAME: new websocket frame has arrived. `ev_data` is `struct websocket_message *` -- MG_EV_HTTP_PART_BEGIN: new part of multipart message is started. - Extra parameters are passed in mg_http_multipart_part -- MG_EV_HTTP_PART_DATA: new portion of data from multiparted message has arrived. - No additional headers are available, only data and data size. -- MG_EV_HTTP_PART_END: final boundary received. Marks the end of the multipart message. +- MG_EV_HTTP_PART_BEGIN: new part of multipart message is started, + extra parameters are passed in mg_http_multipart_part +- MG_EV_HTTP_PART_DATA: new portion of data from multiparted message + no additional headers are available, only data and data size +- MG_EV_HTTP_PART_END: final boundary received, analogue to maybe used to + find the end of packet Note: Mongoose should be compiled with MG_ENABLE_HTTP_STREAMING_MULTIPART to enable MG_EV_HTTP_MULTIPART_REQUEST, MG_EV_HTTP_REQUEST_END, MG_EV_HTTP_REQUEST_CANCEL, MG_EV_HTTP_PART_BEGIN, MG_EV_HTTP_PART_DATA, diff --git a/docs/c-api/http.h/mg_url_decode.md b/docs/c-api/http.h/mg_url_decode.md index b0edaada..9e2f7e78 100644 --- a/docs/c-api/http.h/mg_url_decode.md +++ b/docs/c-api/http.h/mg_url_decode.md @@ -7,12 +7,12 @@ signature: | int is_form_url_encoded); --- -Decodes URL-encoded string. +Decode URL-encoded string. Source string is specified by (`src`, `src_len`), and destination is (`dst`, `dst_len`). If `is_form_url_encoded` is non-zero, then `+` character is decoded as a blank space character. This function guarantees to `\0`-terminate the destination. If destination is too small, -then the source string is partially decoded and `-1` is returned. Otherwise, +then source string is partially decoded and `-1` is returned. Otherwise, a length of decoded string is returned, not counting final `\0`.