ghttpCompletedCallback

GameSpy SDK

ghttpCompletedCallback

Called when the entire file has been received.

typedef GHTTPBool (*ghttpCompletedCallback)(
GHTTPRequest request,
GHTTPResult result,
char * buffer,
GHTTPByteCount bufferLen,
void * param );
RoutineRequired HeaderDistribution
ghttpCompletedCallback<ghttp.h>SDKZIP

Return Value

If ghttpGetFile[Ex] was used, return true to have the buffer freed, false if the app will free the buffer.

Parameters

request
[in] A valid request object
result
[in] The result (success or an error).
buffer
[in] The file's bytes (only valid if ghttpGetFile[Ex] was used).
bufferLen
[in] The file's length.
param
[in] Optional free-format user data for use by the callback

Remarks

If ghttpStreamFileEx or ghttpSaveFile[Ex] was used, buffer is NULL, bufferLen is the number of bytes in the file, and the return value is ignored.
If ghttpGetFile[Ex] was used, return true to have the buffer freed, false if the app will free the buffer. If true, the buffer cannot be accessed once the callback returns. If false, the app can use the buffer even after this call returns, but must free it at some later point. There will always be a file, even if there was an error, although for errors it may be an empty file.