Genivia Home Documentation
gsoapWinInet.cpp File Reference

updated Thu Jun 4 2020 by Robert van Engelen
 
Classes | Macros | Functions | Variables
gsoapWinInet.cpp File Reference
#include "gsoapWinInet.h"
Include dependency graph for gsoapWinInet.cpp:

Classes

struct  wininet_data
 

Macros

#define _ASSERTE(b)
 
#define UNUSED_ARG(x)    (x)
 
#define INVALID_BUFFER_LENGTH   ((DWORD)-1)
 
#define wininet_free_error_message(x)
 

Functions

static BOOL wininet_init (struct soap *soap, struct wininet_data *a_pData, DWORD a_dwRequestFlags)
 
static int wininet_copy (struct soap *soap, struct soap_plugin *a_pDst, struct soap_plugin *a_pSrc)
 
static void wininet_delete (struct soap *soap, struct soap_plugin *a_pPluginData)
 
static SOAP_SOCKET wininet_connect (struct soap *soap, const char *a_pszEndpoint, const char *a_pszHost, int a_nPort)
 
static int wininet_post_header (struct soap *soap, const char *a_pszKey, const char *a_pszValue)
 
static int wininet_fsend (struct soap *soap, const char *a_pBuffer, size_t a_uiBufferLen)
 
static size_t wininet_frecv (struct soap *soap, char *a_pBuffer, size_t a_uiBufferLen)
 
static int wininet_disconnect (struct soap *soap)
 
void CALLBACK wininet_callback (HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength)
 
static BOOL wininet_have_connection (struct soap *soap, struct wininet_data *a_pData)
 
static DWORD wininet_set_timeout (struct soap *soap, struct wininet_data *a_pData, const char *a_pszTimeout, DWORD a_dwOption, int a_nTimeout)
 
static BOOL wininet_resolve_send_error (HINTERNET a_hHttpRequest, DWORD a_dwErrorCode)
 
int wininet_plugin (struct soap *soap, struct soap_plugin *a_pPluginData, void *a_dwRequestFlags)
 
void wininet_set_rse_callback (struct soap *soap, wininet_rse_callback a_pRsecallback)
 

Variables

static const char wininet_id [] = "wininet-2.3"
 

Macro Definition Documentation

#define _ASSERTE (   b)
#define INVALID_BUFFER_LENGTH   ((DWORD)-1)
#define UNUSED_ARG (   x)    (x)
#define wininet_free_error_message (   x)

Function Documentation

void CALLBACK wininet_callback ( HINTERNET  hInternet,
DWORD_PTR  dwContext,
DWORD  dwInternetStatus,
LPVOID  lpvStatusInformation,
DWORD  dwStatusInformationLength 
)

this is mostly for debug tracing

static SOAP_SOCKET wininet_connect ( struct soap *  soap,
const char *  a_pszEndpoint,
const char *  a_pszHost,
int  a_nPort 
)
static

Called from a client proxy to open a connection to a Web Service located at endpoint. Input parameters host and port are micro-parsed from endpoint. Should return a valid file descriptor, or SOAP_INVALID_SOCKET and soap->error set to an error code. Built-in gSOAP function: tcp_connect

static int wininet_copy ( struct soap *  soap,
struct soap_plugin *  a_pDst,
struct soap_plugin *  a_pSrc 
)
static

copy the private data structure's parameters

static void wininet_delete ( struct soap *  soap,
struct soap_plugin *  a_pPluginData 
)
static

deallocate of our private structure

static int wininet_disconnect ( struct soap *  soap)
static

Called by client proxy multiple times, to close a socket connection before a new socket connection is established and at the end of communications when the SOAP_IO_KEEPALIVE flag is not set and soap.keep_alive = 0 (indicating that the other party supports keep alive). Should return SOAP_OK, or a gSOAP error code. Built-in gSOAP function: tcp_disconnect

static size_t wininet_frecv ( struct soap *  soap,
char *  a_pBuffer,
size_t  a_uiBufferLen 
)
static

Called for all receive operations to fill buffer s of maximum length n. Should return the number of bytes read or 0 in case of an error, e.g. EOF. Built-in gSOAP function: frecv

static int wininet_fsend ( struct soap *  soap,
const char *  a_pBuffer,
size_t  a_uiBufferLen 
)
static

Called for all send operations to emit contents of s of length n. Should return SOAP_OK, or a gSOAP error code. Built-in gSOAP function: fsend

Notes: I do a heap of buffering here because we need the entire message available in a single buffer in order to iterate through the sending loop. I had hoped that the SOAP_IO_STORE flag would have worked to do the same, however this still breaks the messages up into blocks. Although there were a number of ways this could've been implemented, this works and supports all of the possible SOAP_IO flags, even though the entire message is still buffered the same as if SOAP_IO_STORE was used.

static BOOL wininet_have_connection ( struct soap *  soap,
struct wininet_data a_pData 
)
static

check to ensure that our connection hasn't been disconnected and disconnect remaining handles if necessary.

static BOOL wininet_init ( struct soap *  soap,
struct wininet_data a_pData,
DWORD  a_dwRequestFlags 
)
static

initialize private data

int wininet_plugin ( struct soap *  soap,
struct soap_plugin *  a_pPluginData,
void *  a_dwRequestFlags 
)

plugin registration

static int wininet_post_header ( struct soap *  soap,
const char *  a_pszKey,
const char *  a_pszValue 
)
static

Called by http_post and http_response (through the callbacks). Emits HTTP key: val header entries. Should return SOAP_OK, or a gSOAP error code. Built-in gSOAP function: http_post_header.

static BOOL wininet_resolve_send_error ( HINTERNET  a_hHttpRequest,
DWORD  a_dwErrorCode 
)
static
void wininet_set_rse_callback ( struct soap *  soap,
wininet_rse_callback  a_pRsecallback 
)
static DWORD wininet_set_timeout ( struct soap *  soap,
struct wininet_data a_pData,
const char *  a_pszTimeout,
DWORD  a_dwOption,
int  a_nTimeout 
)
static

Variable Documentation

const char wininet_id[] = "wininet-2.3"
static

plugin id