ghttpProgressCallback

GameSpy SDK

ghttpProgressCallback

Called with updates on the current state of the request.

typedef void (*ghttpProgressCallback)(
GHTTPRequest request,
GHTTPState state,
const char * buffer,
GHTTPByteCount bufferLen,
GHTTPByteCount bytesReceived,
GHTTPByteCount totalSize,
void * param );
RoutineRequired HeaderDistribution
ghttpProgressCallback<ghttp.h>SDKZIP

Parameters

request
[in] A valid request object.
state
[in] The current state of the request.
buffer
[in] The file's bytes so far, NULL if state < GHTTPReceivingFile.
bufferLen
[in] The number of bytes in the buffer, 0 if state < GHTTPReceivingFile.
bytesReceived
[in] The total number of bytes received, 0 if state < GHTTPReceivingFile.
totalSize
[in] The total size of the file, -1 if unknown.
param
[in] Optional free-format user data for use by the callback.

Remarks

The buffer should not be accessed once this callback returns.
If ghttpGetFile[Ex] was used, buffer contains all of the data that has been received so far, and bufferSize is the total number of bytes received.
If ghttpSaveFile[Ex] was used, buffer only contains the most recent data that has been received. This same data is saved to the file. The buffer will not be valid after this callback returns.
If ghttpStreamFileEx was used, buffer only contains the most recent data that has been received. This data will be lost once the callback returns, and should be copied if it needs to be saved. bufferSize is the number of bytes in the current block of data.