Response ========== --------------------------------------------------------------- Types --------------------------------------------------------------- .. c:struct:: ymo_http_response HTTP response structure. .. todo:: Should it just be one buffer for the whole status line? .. code-block:: c :caption: Definition struct ymo_http_response { ymo_http_session_t* session; ymo_http_exchange_t* exchange; struct ymo_http_response* next; ymo_http_hdr_table_t headers; size_t content_len; char content_len_str[21]; size_t status_len; char status_str[STATUS_STR_BUFF_SIZE]; ymo_bucket_t* body_head; ymo_bucket_t* body_tail; ymo_proto_t* proto_new; ymo_http_status_t status; ymo_http_flags_t flags; }; --------------------------------------------------------------- Functions --------------------------------------------------------------- .. c:function:: ymo_http_response_t* ymo_http_response_create(ymo_http_session_t* session) Create a new http response object. :returns: pointer to new instance on success; NULL on failure .. c:function:: ymo_bucket_t* ymo_http_response_start( ymo_conn_t* conn, ymo_http_response_t* response) Serialize an http response headers into a send-able string. .. c:function:: ymo_bucket_t* ymo_http_response_body_get( ymo_conn_t* conn, ymo_http_response_t* response) Retrieve whatever body data we have, adding chunk headers, if need be. .. c:function:: void ymo_http_response_free(ymo_http_response_t* response) Free an http response object. :param response: HTTP response to free.