DWCGHTTPCompletedCallback

C Specification

#include <dwc.h>

typedef void (*DWCGHTTPCompletedCallback)(
                             const char* buf,
                             int len,
                             DWCGHTTPResult result,
                             void* param );

Description

This function is called when uploading or downloading data with DWC_PostGHTTPData, DWC_GetGHTTPData, or DWC_GetGHTTPDataEx has completed.

This callback function can be set using DWC_PostGHTTPData, DWC_GetGHTTPData, or DWC_GetGHTTPDataEx.

Arguments

buf Receive data storage buffer. NULL during upload.
len Size of the received data. 0 during upload.
result Result of the upload/download. If an error occurs, a DWC error is set by the library. DWC errors can be obtained using DWC_GetLastErrorEx.
param Parameter for the callback specified by DWC_PostGHTTPData, DWC_GetGHTTPData, or DWC_GetGHTTPDataEx.

result takes any of the following values.

DWC_GHTTP_SUCCESS Succeeded in getting file.
DWC_GHTTP_OUT_OF_MEMORY Memory allocation failed.
DWC_GHTTP_BUFFER_OVERFLOW Get file failed because buffer was too small.
DWC_GHTTP_PARSE_URL_FAILED URL analysis error.
DWC_GHTTP_HOST_LOOKUP_FAILED Failed to find host name.
DWC_GHTTP_SOCKET_FAILED Failed to create, initialize, read, or write socket.
DWC_GHTTP_CONNECT_FAILED Failed to connect to HTTP server.
DWC_GHTTP_BAD_RESPONSE Analysis error of HTTP server response.
DWC_GHTTP_REQUEST_REJECTED Request rejected by the HTTP server.
DWC_GHTTP_UNAUTHORIZED Unauthorized file acquisition.
DWC_GHTTP_FORBIDDEN Rejected file send from HTTP server.
DWC_GHTTP_FILE_NOT_FOUND Failed to find file on HTTP server.
DWC_GHTTP_SERVER_ERROR Internal HTTP server error.
DWC_GHTTP_FILE_WRITE_FAILED Writing to local file error.
DWC_GHTTP_FILE_READ_FAILED Reading from local file error.
DWC_GHTTP_FILE_INCOMPLETE Aborted download.
DWC_GHTTP_FILE_TOO_BIG Download impossible because file is too large.
DWC_GHTTP_ENCRYPTION_ERROR Encryption error.
DWC_GHTTP_MEMORY_ERROR Memory allocation failed.

Return Values

None.

See Also

DWC_PostGHTTPData, DWC_GetGHTTPData, DWC_GetGHTTPDataEx

Revision History

2005/12/16 Added a description of the callback select function.
10/27/2005 Initial version.