c-icap-doc  0.1
Macros | Typedefs | Functions
ICAP request API

ICAP request related API. More...

Macros

#define ci_req_lock_data(req)   ((req)->data_locked = 1)
 Lock a ci_request_t object. More...
 
#define ci_req_unlock_data(req)   ((req)->data_locked = 0)
 Unlock a ci_request_t object. More...
 
#define ci_req_hasbody(req)   ((req)->hasbody)
 
#define ci_req_type(req)   ((req)->type)
 
#define ci_req_preview_size(req)   ((req)->preview) /*The preview data size*/
 
#define ci_req_allow204(req)   ((req)->allow204)
 
#define ci_req_allow206(req)   ((req)->allow206)
 
#define ci_req_allow206_outside_preview(req)   ((req)->allow206 && (req)->allow204)
 
#define ci_req_sent_data(req)   ((req)->status)
 
#define ci_req_hasalldata(req)   ((req)->eof_received)
 

Typedefs

typedef struct ci_request ci_request_t
 This is the struct which holds all the data which represent an ICAP request. More...
 

Functions

const char * ci_icap_add_xheader (ci_request_t *req, const char *header)
 Add an icap X-header to the icap response headers. More...
 
int ci_icap_append_xheaders (ci_request_t *req, ci_headers_list_t *headers)
 Append the icap X-headers to the icap response headers. More...
 

Detailed Description

ICAP request related API.

Macro Definition Documentation

#define ci_req_allow204 (   req)    ((req)->allow204)
Parameters
reqis pointer to an object of type ci_request_t
Returns
True (non zero int) if the ICAP request supports "Allow 204"
#define ci_req_allow206 (   req)    ((req)->allow206)
Parameters
reqis pointer to an object of type ci_request_t
Returns
True (non zero int) if the ICAP request supports "Allow 206"
#define ci_req_allow206_outside_preview (   req)    ((req)->allow206 && (req)->allow204)
Parameters
reqis pointer to an object of type ci_request_t
Returns
True (non zero int) if the ICAP request supports "Allow 206" outside preview requests
#define ci_req_hasalldata (   req)    ((req)->eof_received)
Parameters
reqis pointer to an object of type ci_request_t
Returns
True (non zero int) if the ICAP client has sent all the data (headers and body data) to the ICAP server
Examples:
services/echo/srv_echo.c.
#define ci_req_hasbody (   req)    ((req)->hasbody)
Parameters
reqis pointer to an object of type ci_request_t
Returns
true (non zero int) if the ICAP request contains body data else zero
Examples:
services/echo/srv_echo.c.
#define ci_req_lock_data (   req)    ((req)->data_locked = 1)

Lock a ci_request_t object.

After called the c-icap server stops sending body data to the ICAP client.

Parameters
reqis pointer to an object of type ci_request_t
#define ci_req_preview_size (   req)    ((req)->preview) /*The preview data size*/
Parameters
reqis pointer to an object of type ci_request_t
Returns
The ICAP preview size
#define ci_req_sent_data (   req)    ((req)->status)
Parameters
reqis pointer to an object of type ci_request_t
Returns
True (non zero int) if the c-icap server has send data to the client
#define ci_req_type (   req)    ((req)->type)
Returns
ICAP_OPTIONS, ICAP_REQMOD or ICAP_RESPMOD if the ICAP request is options, request modification or response modification ICAP request
#define ci_req_unlock_data (   req)    ((req)->data_locked = 0)

Unlock a ci_request_t object.

When called the c-icap server will start sending body data to the ICAP client.

Parameters
reqis pointer to an object of type ci_request_t
Examples:
services/echo/srv_echo.c.

Typedef Documentation

This is the struct which holds all the data which represent an ICAP request.

The developers should not access directly the fields of this struct but better use the documented macros and functions

Function Documentation

const char* ci_icap_add_xheader ( ci_request_t req,
const char *  header 
)

Add an icap X-header to the icap response headers.

It can be used with both request and response modification ICAP requests.

Parameters
reqis a pointer to the current ICAP request object.
headeris the header to add in the form "Header: Value"
Returns
pointer to the header in success or NULL otherwise
int ci_icap_append_xheaders ( ci_request_t req,
ci_headers_list_t headers 
)

Append the icap X-headers to the icap response headers.

It can be used with both request and response modification ICAP requests.

Parameters
reqis a pointer to the current ICAP request object.
headersis a pointer to the headers object to add
Returns
pointer to the header in success or NULL otherwise