Genivia Home Documentation
curlapi.c File Reference

updated Mon Jan 22 2024 by Robert van Engelen
 
Functions | Variables
curlapi.c File Reference
#include "curlapi.h"
Include dependency graph for curlapi.c:

Functions

static int soap_curl_init (struct soap *soap, struct soap_curl_data *data, CURL *curl)
 
static void soap_curl_delete (struct soap *soap, struct soap_plugin *p)
 Deletes plugin data.
 
static int soap_curl_connect_callback (struct soap *soap, const char *endpoint, const char *host, int port)
 The fconnect callback invokes this function to override connecting to an endpoint.
 
static int soap_curl_send_callback (struct soap *soap, const char *buf, size_t len)
 The fsend callback invokes this function to override sending data by saving in a blist.
 
static int soap_curl_prepare_init_recv_callback (struct soap *soap)
 The fprepareinitrecv callback invokes this function to override the start of receiving data and ending of sending.
 
static int soap_curl_prepare_final_recv_callback (struct soap *soap)
 The fpreparefinalrecv callback resets the recv callback.
 
static size_t soap_curl_recv_callback (struct soap *soap, char *buf, size_t size)
 The frecv callback invokes this function to override receiving data that is stored in a blist.
 
static size_t soap_curl_read_callback (void *buffer, size_t size, size_t nitems, void *ptr)
 The CURL read callback invokes this function to read data to send.
 
static size_t soap_curl_write_callback (void *buffer, size_t size, size_t nitems, void *ptr)
 The CURL write callback invokes this function to write data that was received.
 
SOAP_FMAC1 int SOAP_FMAC2 soap_curl (struct soap *soap, struct soap_plugin *p, void *arg)
 Plugin registry function, used with soap_register_plugin and soap_register_plugin_arg.
 
SOAP_FMAC1 void SOAP_FMAC2 soap_curl_reset (struct soap *soap)
 Reset the plugin so gSOAP IO behaves normally. This is an optional API call, not required except when serializing data after an error.
 

Variables

const char soap_curl_id [] = SOAP_CURL_ID
 

Function Documentation

◆ soap_curl()

SOAP_FMAC1 int SOAP_FMAC2 soap_curl ( struct soap * soap,
struct soap_plugin * p,
void * arg )

Plugin registry function, used with soap_register_plugin and soap_register_plugin_arg.

Parameters
soapcontext
[in,out]pplugin created in registry
[in]argpassed from soap_register_plugin_arg
Returns
SOAP_OK

◆ soap_curl_connect_callback()

static int soap_curl_connect_callback ( struct soap * soap,
const char * endpoint,
const char * host,
int port )
static

The fconnect callback invokes this function to override connecting to an endpoint.

Parameters
soapcontext
endpointURL to connect to, use "" if the CURL handle has a URL assigned with CURLOPT_URL
hostnot used
portnot used
Returns
SOAP_OK or error code

◆ soap_curl_delete()

static void soap_curl_delete ( struct soap * soap,
struct soap_plugin * p )
static

Deletes plugin data.

Parameters
soapcontext
[in,out]pplugin

◆ soap_curl_init()

static int soap_curl_init ( struct soap * soap,
struct soap_curl_data * data,
CURL * curl )
static

◆ soap_curl_prepare_final_recv_callback()

static int soap_curl_prepare_final_recv_callback ( struct soap * soap)
static

The fpreparefinalrecv callback resets the recv callback.

Parameters
soapcontext
Returns
SOAP_OK or error code

◆ soap_curl_prepare_init_recv_callback()

static int soap_curl_prepare_init_recv_callback ( struct soap * soap)
static

The fprepareinitrecv callback invokes this function to override the start of receiving data and ending of sending.

Parameters
soapcontext
Returns
SOAP_OK or error code

◆ soap_curl_read_callback()

static size_t soap_curl_read_callback ( void * buffer,
size_t size,
size_t nitems,
void * ptr )
static

The CURL read callback invokes this function to read data to send.

Parameters
bufferread data into this buffer, buffer is size*nitems large.
size
nitems
ptrpoints to soap_curl_data plugin data
Returns
number of bytes read, 0 for end or error

◆ soap_curl_recv_callback()

static size_t soap_curl_recv_callback ( struct soap * soap,
char * buf,
size_t size )
static

The frecv callback invokes this function to override receiving data that is stored in a blist.

Parameters
soapcontext
bufreceive in this buffer
sizebuffer size
Returns
number of bytes read, 0 for end or error

◆ soap_curl_reset()

SOAP_FMAC1 void SOAP_FMAC2 soap_curl_reset ( struct soap * soap)

Reset the plugin so gSOAP IO behaves normally. This is an optional API call, not required except when serializing data after an error.

Parameters
soapcontext

◆ soap_curl_send_callback()

static int soap_curl_send_callback ( struct soap * soap,
const char * buf,
size_t len )
static

The fsend callback invokes this function to override sending data by saving in a blist.

Parameters
soapcontext
bufdata to send
lennumber of bytes to send
Returns
SOAP_OK or error code

◆ soap_curl_write_callback()

static size_t soap_curl_write_callback ( void * buffer,
size_t size,
size_t nitems,
void * ptr )
static

The CURL write callback invokes this function to write data that was received.

Parameters
bufferdata to write of size*nitems bytes total.
size
nitems
ptrpoints to soap_curl_data plugin data
Returns
number of bytes written, 0 for error

Variable Documentation

◆ soap_curl_id

const char soap_curl_id[] = SOAP_CURL_ID

Plugin identification for plugin registry