Go to the source code of this file.
#define SOCKET_INPUT_SIZE 4096 |
Definition at line 147 of file mtp_http.h.
Referenced by message_InitializeFromConnection(), message_send_Thread(), and mtp_http_InitializeFromConnection().
typedef struct mtp_http_content_s mtp_http_content_t |
typedef mtp_http_t* mtp_http_p |
Definition at line 145 of file mtp_http.h.
typedef struct mtp_http_s mtp_http_t |
enum http_performative_e |
http 'verbs'
HTTP_PERFORMATIVE_UNDEF | |
HTTP_PERFORMATIVE_ZERO | |
HTTP_HEAD | |
HTTP_GET | |
HTTP_POST | |
HTTP_PUT | |
HTTP_DELETE | |
HTTP_TRACE | |
HTTP_OPTIONS | |
HTTP_CONNECT | |
HTTP_RESPONSE | |
HTTP_NUM_PERFORMATIVES |
Definition at line 90 of file mtp_http.h.
enum http_status_code_e |
http return status codes
Definition at line 45 of file mtp_http.h.
const char* http_GetExpression | ( | const char * | string, | |
char ** | expr | |||
) |
Parse an html expression.
string | (input) The html block of text: Will parse the first expression pointed to by 'string'. | |
expr | (output) The allocated expression |
Definition at line 349 of file mtp_http.c.
Referenced by mtp_http_Parse(), and mtp_http_ParseHeader().
const char* http_GetToken | ( | const char * | string, | |
char ** | token | |||
) |
int http_ParseExpression | ( | const char * | expression_string, | |
char ** | name, | |||
char ** | value | |||
) |
Parse an expression into its name and value.
expression_string | (input) The expression | |
name | (output) An allocated name string or NULL | |
value | (output) An allocated value string or NULL |
Definition at line 408 of file mtp_http.c.
References CHECK_NULL, MC_ERR_PARSE, and MC_SUCCESS.
Referenced by mtp_http_Parse(), and mtp_http_ParseHeader().
const char* http_ParseRequest | ( | mtp_http_p | http, | |
const char * | string | |||
) |
Definition at line 701 of file mtp_http.c.
References cur, HTTP_CONNECT, HTTP_DELETE, HTTP_GET, http_GetToken(), HTTP_HEAD, HTTP_OPTIONS, mtp_http_s::http_performative, HTTP_PERFORMATIVE_UNDEF, HTTP_POST, HTTP_PUT, HTTP_RESPONSE, HTTP_TRACE, mtp_http_s::response_code, mtp_http_s::response_string, and mtp_http_s::target.
Referenced by mtp_http_ParseHeader().
Referenced by message_send_Thread().
struct message_s* mtp_http_CreateMessage | ( | mtp_http_t * | mtp_http, | |
char * | hostname, | |||
int | port | |||
) | [read] |
Definition at line 875 of file mtp_http.c.
References buf, mtp_http_s::content, mtp_http_content_s::content_type, mtp_http_content_s::data, dynstring_Append(), dynstring_Destroy(), dynstring_New(), mtp_http_s::host, message_s::isHTTP, dynstring_s::len, dynstring_s::message, message_s::message_body, message_New(), mtp_http_s::message_parts, PACKAGE_VERSION, mtp_http_s::target, and message_s::to_address.
Referenced by MC_AclSend().
int mtp_http_Destroy | ( | mtp_http_p | http | ) |
Definition at line 54 of file mtp_http.c.
References mtp_http_s::accept_ranges, mtp_http_s::boundary, mtp_http_s::cache_control, mtp_http_s::connection, mtp_http_s::content, mtp_http_s::content_length, mtp_http_content_s::content_type, mtp_http_s::content_type, mtp_http_content_s::data, mtp_http_s::date, mtp_http_s::host, mtp_http_s::http_version, mtp_http_s::message_parts, mtp_http_s::mime_version, mtp_http_s::response_string, mtp_http_s::return_code, SAFE_FREE, mtp_http_s::server, mtp_http_s::target, and mtp_http_s::user_agent.
Referenced by acc_connection_Thread(), MC_AclSend(), message_send_Thread(), and mtp_http_InitializeFromConnection().
int mtp_http_InitializeFromConnection | ( | struct mtp_http_s * | http, | |
struct connection_s * | connection, | |||
char * | privatekey | |||
) |
Referenced by acc_connection_Thread().
mtp_http_p mtp_http_New | ( | void | ) |
Definition at line 89 of file mtp_http.c.
References CHECK_NULL, and mtp_http_s::content.
Referenced by acc_connection_Thread(), MC_AclSend(), message_send_Thread(), and mtp_http_InitializeFromConnection().
int mtp_http_Parse | ( | struct mtp_http_s * | http, | |
const char * | string | |||
) |
Definition at line 551 of file mtp_http.c.
References mtp_http_s::boundary, mtp_http_s::content, mtp_http_s::content_length, mtp_http_content_s::content_type, mtp_http_s::content_type, mtp_http_content_s::data, http_GetExpression(), HTTP_HEAD, http_ParseExpression(), mtp_http_s::http_performative, HTTP_POST, HTTP_PUT, HTTP_RESPONSE, MC_SUCCESS, mtp_http_s::message_parts, and mtp_http_ParseHeader().
Referenced by message_send_Thread(), and mtp_http_InitializeFromConnection().
const char* mtp_http_ParseHeader | ( | struct mtp_http_s * | http, | |
const char * | string | |||
) |
Definition at line 467 of file mtp_http.c.
References mtp_http_s::header_length, http_GetExpression(), HTTP_PARSE_EXPR, http_ParseExpression(), http_ParseRequest(), MC_SUCCESS, and SAFE_FREE.
Referenced by mtp_http_InitializeFromConnection(), and mtp_http_Parse().