ReadClient - ISAPI read data from body of client's HTTP request.
/* cb is either an extension control block or a filter context; see isapi(7). */ HCONN connid = (extension) ? cb->ConnID : cb; void *buffer = malloc(enough); int bufsiz = enough;
if ((*(cb->ReadClient))( connid, buffer, &bufsiz )) { /* buffer contains data, '\0'-terminated; bufsiz contains its length */ } else { /* handle failure */ } free(buffer);
ReadClient reads up to bufsiz bytes of data, from the client's HTTP request, into the given buffer. This method is provided for ISAPI extension libraries as a field of the control block passed to HttpExtensionProc. It is only needed when the control block's cbTotalBytes field (is 0xffffffff or) exceeds the block's cbAvailable: it is used to obtain any excess data beyond that provided in the lpbData array of the control block.
If the input value of bufsiz exceeds the amount of data available from the client at the time ReadClient is called, ReadClient may block, or it may return a smaller amount of data. In any case, once data is available ReadClient will write data to the given buffer, update bufsiz to indicate the amount of data written and return TRUE. When the client closes the connection (all data has been read), ReadClient returns TRUE with bufsiz set to zero.
First parameter is a connection identifier; this should be the ConnID field of the extension control block from which ReadClient was obtained (no ReadClient is provided to an HttpFilterProc).
Second argument is a pointer to the start of an area of memory; third argument, bufsiz, is a pointer to an integer variable whose value, when ReadClient is called, is the number of bytes of space in the area of memory pointed to by buffer. ReadClient shall not write outside the area of memory indicated by buffer and bufsiz. On successful return from ReadClient, buffer shall contain the data read and bufsiz is updated to indicate the number of bytes written into buffer; if bufsiz has not changed, the buffer is full.
Returns TRUE on success; FALSE otherwise.
isapi(7),
HttpExtensionProc(3),
EXTENSION_CONTROL_BLOCK(5).
$ZEUSHOME/web/include/httpext.h $ZEUSHOME/web/include/wintypes.h $ZEUSHOME/webadmin/docroot/docs/modules/isapi/*.html
Copyright (C) 2000-2001 Zeus Technology Limited. All rights reserved.