Files
filament/third_party/civetweb/docs/api/mg_send_chunk.md
Philip Rideout 6d74d31ecd Add civetweb to third_party (MIT).
This is a dependency of our upcoming web-based material debugger. This
CL also includes `tnt/CMakeLists.txt`, which builds a static lib in a
minimal configuration that enables WebSocket support. The entire library
is built from only 4 files:

    ${PUBLIC_HDR_DIR}/CivetServer.h
    ${PUBLIC_HDR_DIR}/civetweb.h
    ${SRC_DIR}/civetweb.c
    ${SRC_DIR}/CivetServer.cpp
2019-08-21 17:45:37 -07:00

1.1 KiB

Civetweb API Reference

mg_send_chunk( conn, buf, len );

Parameters

Parameter Type Description
conn struct mg_connection * A pointer to the connection to be used to send data
chunk const void * A pointer to the blob of information to be sent
chunk_len size_t The amount of bytes to be sent

Return Value

Type Description
int An integer indicating the amount of bytes sent, or failure

Description

The function mg_send_chunk() can be used to send a blob of arbitrary data over a connection. Only use this function after sending a complete HTTP request or response header with "Transfer-Encoding: chunked" set. Otherwise: use mg_write(). 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.

See Also