#ifndef _HTTP_ENTRY_H #define _HTTP_ENTRY_H #ifdef __cpluscplus extern "C" { #endif #include "session.h" struct http_string { char *str; size_t len; }; struct http_request_line { struct http_string method; struct http_string uri; struct http_string version; int major_version; int minor_version; }; struct http_response_line { struct http_string version; struct http_string status; int major_version; int minor_version; int status_code; }; struct http_decoder; /****************************************************************************** * For HTTP consumer ******************************************************************************/ void http_session_get_request_line(struct stellar_session *http_session, struct http_request_line *line); void http_session_get_response_line(struct stellar_session *http_session, struct http_response_line *line); void http_session_get_request_raw_body(struct stellar_session *http_session, struct http_string *body); void http_session_get_response_raw_body(struct stellar_session *http_session, struct http_string *body); void http_session_get_request_decompress_body(struct stellar_session *http_session, struct http_string *body); void http_session_get_response_decompress_body(struct stellar_session *http_session, struct http_string *body); size_t http_session_get_request_header(struct stellar_session *http_session, struct http_string *header_key, struct http_string header_val[], size_t val_size); size_t http_session_get_response_header(struct stellar_session *http_session, struct http_string *header_key, struct http_string header_val[], size_t val_size); void http_session_iter_request_header(struct stellar_session *http_session, size_t *iter_index, struct http_string *header_key, struct http_string *header_val); void http_session_iter_response_header(struct stellar_session *http_session, size_t *iter_index, struct http_string *header_key, struct http_string *header_val); /****************************************************************************** * For HTTP decoder ******************************************************************************/ void http_entry(struct stellar_session *tcp_session, const char *tcp_event, int thread_id); /****************************************************************************** * For gtest ******************************************************************************/ #ifdef __cpluscplus } #endif #endif