/home/dko/projects/mobilec/trunk/src/include/mtp_http.h File Reference

Go to the source code of this file.


Data Structures

struct mtp_http_s

Defines

#define SOCKET_INPUT_SIZE 4096

Typedefs

typedef struct mtp_http_s mtp_http_t

Enumerations

http return status codes More...
http 'verbs' More...

Functions

const char * http_GetExpression (const char *string, char **expr)
Parse an html expression.
int http_ParseExpression (const char *expression_string, char **name, char **value)
Parse an expression into its name and value.
const char * http_ParseRequest (mtp_http_p http, const char *string)
const char * http_GetToken (const char *string, char **token)
int mtp_http_InitializeFromConnection (struct mtp_http_s *http, struct connection_s *connection)
const char * mtp_http_ParseHeader (struct mtp_http_s *http, const char *string)
int mtp_http_Parse (struct mtp_http_s *http, const char *string)
struct message_s * mtp_http_CreateMessage (mtp_http_t *mtp_http, char *hostname, int port)

Define Documentation

#define SOCKET_INPUT_SIZE 4096

Definition at line 147 of file mtp_http.h.

Referenced by message_InitializeFromConnection(), message_Send(), and mtp_http_InitializeFromConnection().


Typedef Documentation

Definition at line 145 of file mtp_http.h.

typedef struct mtp_http_s mtp_http_t


Enumeration Type Documentation

http 'verbs'

Enumerator:
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.

http return status codes

Enumerator:
CONTINUE
SWITCHING_PROTOCOLS
PROCESSING
OK
CREATED
ACCEPTED
NON_AUTHORITATIVE_INFORMATION
NO_CONTENT
RESET_CONTENT
PARTIAL_CONTENT
MULTI_STATUS
BAD_REQUEST
UNAUTHORIZED
PAYMENT_REQUIRED
FORBIDDEN
NOT_FOUND
METHOD_NOT_ALLOWED
NOT_ACCEPTABLE
PROXY_AUTHENTICATION_REQUIRED
REQUEST_TIMEOUT
CONFLICT
GONE
LENGTH_REQUIRED
PRECONDITION_FAILED
REQUST_ENTITY_TOO_LARGE
REQUEST_URI_TOO_LONG
UNSUPPORTED_MEDIA_TYPE
REQUESTED_RANGE_NOT_SATISFIABLE
EXPECTATION_FAILED
UNPROCESSABLE_ENTITY
LOCKED
FAILED_DEPENDANCY
UNORDERED_COLLECTION
UPGRADE_REQUIRED
RETRY_WITH

Definition at line 45 of file mtp_http.h.


Function Documentation

const char* http_GetExpression ( const char * string,
char ** expr
)

Parse an html expression.

Parameters:
string (input) The html block of text: Will parse the first expression pointed to by 'string'.
expr (output) The allocated expression
Returns:
A pointer to the next expression segment of the string block, or NULL.

Definition at line 224 of file mtp_http.c.

Referenced by mtp_http_Parse(), and mtp_http_ParseHeader().

const char* http_GetToken ( const char * string,
char ** token
)

Definition at line 662 of file mtp_http.c.

References cur.

Referenced by http_ParseRequest().

int http_ParseExpression ( const char * expression_string,
char ** name,
char ** value
)

Parse an expression into its name and value.

Parameters:
expression_string (input) The expression
name (output) An allocated name string or NULL
value (output) An allocated value string or NULL
Returns:
error_code_t type
Note:
an http expression is something like 'Date: 2005年5月23日 22:38:34 GMT
' where 'Date' is the name and the remainder of the string is the value

Definition at line 283 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 573 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().

int mtp_http_ComposeMessage ( struct message_s * message )

Referenced by message_Send().

struct message_s* mtp_http_CreateMessage ( mtp_http_t * mtp_http,
char * hostname,
int port
) [read]

Definition at line 747 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 53 of file mtp_http.c.

References mtp_http_s::accept_ranges, mtp_http_s::boundary, 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::return_code, SAFE_FREE, mtp_http_s::server, mtp_http_s::target, and mtp_http_s::user_agent.

Referenced by acc_Thread(), MC_AclSend(), and mtp_http_InitializeFromConnection().

int mtp_http_InitializeFromConnection ( struct mtp_http_s * http,
struct connection_s * connection
)

Referenced by acc_Thread().

mtp_http_p mtp_http_New ( void )

Definition at line 85 of file mtp_http.c.

References CHECK_NULL, and mtp_http_s::content.

Referenced by acc_Thread(), MC_AclSend(), message_Send(), and mtp_http_InitializeFromConnection().

int mtp_http_Parse ( struct mtp_http_s * http,
const char * string
)

Definition at line 425 of file mtp_http.c.

References mtp_http_s::boundary, mtp_http_s::content, mtp_http_content_s::content_type, mtp_http_s::content_type, mtp_http_content_s::data, http_GetExpression(), 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(), and mtp_http_InitializeFromConnection().

const char* mtp_http_ParseHeader ( struct mtp_http_s * http,
const char * string
)

Definition at line 342 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().


Generated on Tue Oct 28 17:03:24 2008 for Mobile-C by doxygen 1.5.5

AltStyle によって変換されたページ (->オリジナル) /