Droplet
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
httpreply.c File Reference

Functions

dpl_status_t dpl_read_http_reply_buffered (dpl_conn_t *conn, int expect_data, int *http_statusp, dpl_header_func_t header_func, dpl_buffer_func_t buffer_func, void *cb_arg)
 read http reply More...
 
int dpl_connection_close (dpl_dict_t *headers_returned)
 check for Connection header More...
 
char * dpl_location (dpl_dict_t *headers_returned)
 check for Location header More...
 
dpl_status_t dpl_read_http_reply_ext (dpl_conn_t *conn, int expect_data, int buffer_provided, char **data_bufp, unsigned int *data_lenp, dpl_dict_t **headersp, int *connection_closep)
 read http reply simple version More...
 

Function Documentation

int dpl_connection_close ( dpl_dict_t headers_returned)
Parameters
headers_returned
Returns
1 if found
0 if not found
char* dpl_location ( dpl_dict_t headers_returned)
Parameters
headers_returned
Returns
the location
NULL if not found
dpl_status_t dpl_read_http_reply_buffered ( dpl_conn_t conn,
int  expect_data,
int *  http_statusp,
dpl_header_func_t  header_func,
dpl_buffer_func_t  buffer_func,
void *  cb_arg 
)

TODO: use a callback instead of expect_data

Parameters
conn
expect_data// always set to 1, expect for HEAD-like methods!
http_statuspreturns the http status
header_func
buffer_func
cb_arg
Returns
dpl_status
dpl_status_t dpl_read_http_reply_ext ( dpl_conn_t conn,
int  expect_data,
int  buffer_provided,
char **  data_bufp,
unsigned int *  data_lenp,
dpl_dict_t **  headersp,
int *  connection_closep 
)
Parameters
fd
expect_data
buffer_providedif 1 then caller provides buffer and length in *data_bufp and *data_lenp
data_bufpcaller must free it
data_lenp
headerspcaller must free it
Returns
dpl_status