PingAccess Agent SDK for C
|
#include <paa-http-server-facade.h>
Public Attributes | |
void * | impl |
int(* | get_status )(const paa_client_response *resp) |
apr_status_t(* | set_header )(const paa_client_response *resp, const char *name, const char *value) |
apr_status_t(* | add_header )(const paa_client_response *resp, const char *name, const char *value) |
apr_status_t(* | remove_header )(const paa_client_response *resp, const char *name) |
apr_status_t(* | enumerate_headers )(const paa_client_response *resp, paa_header_cb cb, void *userdata) |
apr_status_t(* | replacing )(const paa_client_response *resp) |
apr_status_t(* | set_status )(const paa_client_response *resp, int status, const char *reason) |
paa_client_response_write_cb(* | get_write_cb )(const paa_client_response *resp) |
void *(* | get_write_data )(const paa_client_response *resp) |
The client response interface. This interface is implemented by a HTTP server/proxy to provide access to the HTTP response being served to a client
apr_status_t(* paa_client_response_struct::add_header) (const paa_client_response *resp, const char *name, const char *value) |
Adds a header to the client response.
The following algorithm should be used to add the header value to the client response:
resp | the response handle |
name | the name of the header |
value | the value of the header |
apr_status_t(* paa_client_response_struct::enumerate_headers) (const paa_client_response *resp, paa_header_cb cb, void *userdata) |
Enumerates all headers in the response, invoking the callback for each header value. Headers with multiple values can be passed to the callback in any acceptable format. For example, consider the following response header:
X-Custom-Header: value1, value2 X-Custom-Header: value3
Any of the following of sequences of invocations of the header callback would be acceptable:
cb("X-Custom-Header", "value1"); cb("X-Custom-Header", "value2"); cb("X-Custom-Header", "value3");
cb("X-Custom-Header", "value1, value2"); cb("X-Custom-Header", "value3");
cb("X-Custom-Header", "value1, value2, value3");
Note: this function will only be invoked on a modified client response (i.e., one in which add, set or remove header has been invoked) when the SDK log level is set to DEBUG.
resp | the handle |
cb | the callback used to enumerate the headers |
userdata | the userdata passed to the callback |
int(* paa_client_response_struct::get_status) (const paa_client_response *resp) |
resp | the handle |
paa_client_response_write_cb(* paa_client_response_struct::get_write_cb) (const paa_client_response *resp) |
Note: this field can be safely set to NULL if the paa_http_client interface is not being utilized.
resp | the response handle |
void*(* paa_client_response_struct::get_write_data) (const paa_client_response *resp) |
Note: this field can be safely set to NULL if the paa_http_client interface is not being utilized.
resp | the response handle |
void* paa_client_response_struct::impl |
opaque implementation handle
apr_status_t(* paa_client_response_struct::remove_header) (const paa_client_response *resp, const char *name) |
Removes a header from the client response. All header values for the specified header name should be removed from the headers.
resp | the response handle |
name | the name of the header |
apr_status_t(* paa_client_response_struct::replacing) (const paa_client_response *resp) |
Note: this field can be safely set to NULL if the paa_http_client interface is not being utilized.
Called to indicate that the paa_client_response is being set to the agent response. Implementers of paa_client_response can take this opportunity to prepare the client response for the modification operations that will follow the invocation of this function.
resp | the response handle |
apr_status_t(* paa_client_response_struct::set_header) (const paa_client_response *resp, const char *name, const char *value) |
Sets a header in the client response. The following algorithm should be used to set the header in the response:
1) Remove all headers in the response with name (case-insensitive comparison) 2) Set a single header in the response with name and value
For example, consider the following response header:
X-Custom: value1, value2 X-Custom: value3
If set_header is called with a name of "X-Custom" and a value of "value4", the following response header should result:
X-Custom: value4
Specifically, the values of value1, value2 and value3 are overridden in the response.
resp | the response handle |
name | the name of the header |
value | the value of the header |
apr_status_t(* paa_client_response_struct::set_status) (const paa_client_response *resp, int status, const char *reason) |
Note: this field can be safely set to NULL if the paa_http_client interface is not being utilized.
Sets the status in the client response
resp | the response handle |
status | the status code |
reason | the reason string |