summaryrefslogtreecommitdiffstats
path: root/src/civetweb/docs/api/mg_get_response.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/civetweb/docs/api/mg_get_response.md
parentInitial commit. (diff)
downloadceph-upstream/16.2.11+ds.tar.xz
ceph-upstream/16.2.11+ds.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/civetweb/docs/api/mg_get_response.md')
-rw-r--r--src/civetweb/docs/api/mg_get_response.md29
1 files changed, 29 insertions, 0 deletions
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 000000000..3e7b72711
--- /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)