PingAccess Agent SDK for C
Public Attributes | List of all members
paa_http_context_struct Struct Reference

#include <paa-http-client.h>

Public Attributes

void * impl
 
apr_status_t(* create_request_handle )(const paa_http_context *context, const paa_http_request **request)
 
void(* set_resp_pool )(const paa_http_context *context, apr_pool_t *resp_pool)
 
void(* set_resp_status_cb )(const paa_http_context *context, paa_resp_status_cb cb)
 
void(* set_resp_header_cb )(const paa_http_context *context, paa_resp_header_cb cb)
 
void(* set_resp_body_cb )(const paa_http_context *context, paa_resp_body_cb cb)
 
void(* set_resp_userdata )(const paa_http_context *context, void *userdata)
 
apr_status_t(* send_request )(const paa_http_context *context, const paa_client_request *client_request)
 

Detailed Description

Interface for obtaining a request handle and registering callbacks for processing a response

Member Data Documentation

apr_status_t(* paa_http_context_struct::create_request_handle) (const paa_http_context *context, const paa_http_request **request)

Creates a new paa_http_request, managed by this context.

The context is only required to manage a single request at a time. That is, only the request returned by the most recent call to this function should be considered valid for use.

Parameters
contextthe context handle
requestthe output handle – populated on success
Returns
APR_SUCCESS on success
APR_PAA_HTTP_ERROR on error
void* paa_http_context_struct::impl

opaque implementation handle

apr_status_t(* paa_http_context_struct::send_request) (const paa_http_context *context, const paa_client_request *client_request)

Synchronously sends the request as configured via the request handle returned by create_request_handle. The response callbacks will be invoked as the response is received.

Implementations are free to retry requests on failures, as dictated by the semantics of the request being sent. As such, consumers should be prepared to have callbacks invoked for partial responses. Implementations must ensure that the callbacks are invoked in the order: status, headers, body. A simple way for consumers to account for this behavior is to initialize or reset any state for the response in the status callback as that will always be the first callback invoked for a response.

Parameters
send_handlethe send handle
client_requestthe handle to the client request.
Returns
APR_SUCCESS on success
APR_PAA_HTTP_ERROR on error
void(* paa_http_context_struct::set_resp_body_cb) (const paa_http_context *context, paa_resp_body_cb cb)

Sets the response body callback. This callback will always be invoked even for an empty response body.

The callback should be invoked with a size of 0 when the body is complete.

Parameters
contextthe context handle
cbthe callback
void(* paa_http_context_struct::set_resp_header_cb) (const paa_http_context *context, paa_resp_header_cb cb)

Sets the response header callback

Parameters
contextthe context handle
cbthe callback
void(* paa_http_context_struct::set_resp_pool) (const paa_http_context *context, apr_pool_t *resp_pool)

Sets the pool in which data should be allocated for response data

Parameters
contextthe context handle
resp_poolthe pool in which to allocate response data
void(* paa_http_context_struct::set_resp_status_cb) (const paa_http_context *context, paa_resp_status_cb cb)

Sets the response status callback

Parameters
contextthe context handle
cbthe callback
void(* paa_http_context_struct::set_resp_userdata) (const paa_http_context *context, void *userdata)

Sets the handle passed to response callbacks

Parameters
send_handlethe send handle
userdatathe handle that will be passed to response callbacks

The documentation for this struct was generated from the following file: