Response Body Buffer Callback
|Example: Asynchronous Conversations||Asynchronous Functions - C|
Called when there is content in the response body buffer and at the end of the response body.
int <function name> ( IN const char * aLastBufferStr, IN int aLastBufferLen, IN const char * aAccumulatedStr, IN int aAccumulatedLen, IN int aHttpStatusCode );
A pointer to one of:
The length of the string pointed-to by aLastBufferStr or zero to denote the end of the response data.
A pointer to one of:
The length of the string pointed-to by aAccumulatedStr, or zero to denote the end of the response data
|aHttpStatusCode||The HTTP status return code.|
Returns a value of WEB_ASYNC_CB_RC_ENUM
A response body buffer callback is a user-created function. It is invoked zero or more times for each response body buffer received for the Conversation An Asynchronous Conversation is a series of related web tasks, including tasks caused by redirection. An Asynchronous Conversation starts with the request for the desired response, includes all the requests and responses that are caused by this request (authentication, redirection, and so on) and ends when the desired response is received or when the series of interactions is canceled.. After all of the response body data has been passed to the callback, it is invoked once more with an empty last-buffer string. An empty last-buffer string marks the end of the response body for the current conversation. When the response body is empty, the callback is invoked once to mark the end.
The callback is passed the data extracted from the last read buffer and all response body accumulated to this point.
The response data is processed as follows before being passed to the callback:
- If "Transfer-Encoding: chunked" was specified for the response, any overhead bytes are removed.
- If the response was compressed, it is decompressed. This can leave remainders of data to be handled when more data arrive.
- If required, any decompression remainders from a previous segment are joined to the data of the current segment.
- If required, data is converted to the locale charset.
Chunking overhead or decompression remainders can cause a non-empty received response buffer to yield no data after the processing described above. The callback is not invoked for such buffers.
Decompression can cause the callback to be called multiple times for a single received buffer.