C
static HTTP_READ_STATUS HTTPReadTo( BYTE delim, BYTE* buf, WORD len );
Description
Reads from the TCP buffer to cData until either cDelim is reached, or until wLen - 2 bytes have been read. The value read is saved to cData and null terminated. (wLen - 2 is used so that the value can be passed to HTTPURLDecode later, which requires a null terminator plus one extra free byte.)
The delimiter character is removed from the buffer, but not saved to cData. If all data cannot fit into cData, it will still be removed from the buffer but will not be saved anywhere.
This function properly updates curHTTP.byteCount by decrementing it by the number of bytes read.
Preconditions
None
Parameters
Parameters |
Description |
cDelim |
the character at which to stop reading, or NULL to read to the end of the buffer |
cData |
where to store the data being read |
wLen |
how many bytes can be written to cData |
Return Values
Return Values |
Description |
HTTP_READ_OK |
data was successfully read |
HTTP_READ_TRUNCTATED |
entire data could not fit in the buffer, so the data was truncated and data has been lost |
HTTP_READ_INCOMPLETE |
delimiter character was not found |