From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/civetweb/docs/api/mg_get_response.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/civetweb/docs/api/mg_get_response.md (limited to 'src/civetweb/docs/api/mg_get_response.md') diff --git a/src/civetweb/docs/api/mg_get_response.md b/src/civetweb/docs/api/mg_get_response.md new file mode 100644 index 00000000..3e7b7271 --- /dev/null +++ b/src/civetweb/docs/api/mg_get_response.md @@ -0,0 +1,29 @@ +# Civetweb API Reference + +### `mg_get_response( conn, ebuf, ebuf_len, timeout );` + +### Parameters + +| Parameter | Type | Description | +| :--- | :--- | :--- | +|**`conn`**|`struct mg_connection *`|The connection to listen on| +|**`ebuf`**|`char *`|Buffer to store an error message| +|**`ebuf_len`**|`size_t`|Size of the error message buffer including the terminating NUL| +|**`timeout`**|`int`|Time to wait for a response in milliseconds| + +### Return Value + +| Type | Description | +| :--- | :--- | +|`int`|Success value of the wait| + +### Description + +The function `mg_get_reponse()` wait for a response from a remote server. A return value equal or greater than zero is an indication for success, a negative value us used to signal an error condition. A timeout can be specified which lets the function return after a specified number of milliseconds, even if no data is received from the remote party. If the timeout value is negative, the function will not return until data has been read or an unrecoverable error occurs. + +Error messages are stored in a caller supplied error message buffer. + +### See Also + +* [`mg_connect_client();`](mg_connect_client.md) +* [`mg_connect_client_secure();`](mg_connect_client_secure.md) -- cgit v1.2.3