]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/docs/api/mg_send_chunk.md
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / civetweb / docs / api / mg_send_chunk.md
1 # Civetweb API Reference
2
3 ### `mg_send_chunk( conn, buf, len );`
4
5 ### Parameters
6
7 | Parameter | Type | Description |
8 | :--- | :--- | :--- |
9 |**`conn`**|`struct mg_connection *`| A pointer to the connection to be used to send data |
10 |**`chunk`**|`const void *`| A pointer to the blob of information to be sent |
11 |**`chunk_len`**|`size_t`| The amount of bytes to be sent |
12
13 ### Return Value
14
15 | Type | Description |
16 | :--- | :--- |
17 |`int`| An integer indicating the amount of bytes sent, or failure |
18
19 ### Description
20
21 The function `mg_send_chunk()` can be used to send a blob of arbitrary data over a connection.
22 Only use this function after sending a complete HTTP request or response header with "Transfer-Encoding: chunked" set. Otherwise: use `mg_write()`.
23 The function returns a number **>0** if data was sent, the value **0** when the connection has been closed, and **-1** in case of an error.
24
25 ### See Also
26
27 * [`mg_write();`](mg_write.md)
28 * [`mg_printf();`](mg_print.md)
29 * [`mg_lock_connection();`](mg_lock_connection.md)
30 * [`mg_unlock_connection();`](mg_unlock_connection.md)
31