diff --git a/common/include/tfe_http.h b/common/include/tfe_http.h index b3e34ed..3452088 100644 --- a/common/include/tfe_http.h +++ b/common/include/tfe_http.h @@ -1,4 +1,6 @@ -#include "tfe_connection.h" + +#include +#include #include struct tfe_http_req_spec @@ -16,8 +18,10 @@ struct tfe_http_resp_spec int minor_version; //HTTP 1.1 or 1.0 char* content_encoding; }; + #define HTTP_REQUEST 1 #define HTTP_RESPONSE 2 + struct tfe_http_half { int direction; //HTTP_REQUEST or HTTP_RESPONSE @@ -33,6 +37,7 @@ struct tfe_http_half struct evbuffer *body; void * fields; //hide by protocol layer }; + struct tfe_http_session { int session_sequence;//? @@ -41,6 +46,7 @@ struct tfe_http_session struct tfe_http_half* resp;//value is NULL before response received. void* proto_spec; }; + enum tfe_http_std_field { HTTP_UNKNOWN_FIELD=0, @@ -73,6 +79,7 @@ enum tfe_http_std_field HTTP_X_FLASH_VERSION, HTTP_TRANSFER_LENGTH }; + struct http_field_name { enum tfe_http_std_field field_id; @@ -117,7 +124,7 @@ enum http_ev_bit_number #define EV_HTTP_REQ_BODY_BEGIN ((uint64_t)1<calling_idx=i; plug_ctx=_stream->plug_ctx+i; - if(_stream->is_fisrt_read==1) + if(_stream->is_first_read==1) { action_tmp=plugins[i].on_open(&_stream.head, _stream->thrmgr_ref->thread_id, dir, contiguous_data,contigous_len, &(plug_ctx->pme)); - _stream->is_fisrt_read=0; + _stream->is_first_read=0; } else { @@ -248,6 +249,7 @@ static void tfe_stream_readcb(struct bufferevent * bev, void * arg) } } switch (action_final) + { case ACTION_FORWARD_DATA: if(_stream->forward_bytes>0) @@ -501,7 +503,7 @@ struct tfe_stream_private* tfe_stream_create(evutil_socket_t fd_downstream, evut conn_private->fd_downstream=fd_downstream; conn_private->fd_upstream=fd_upstream; conn_private->thrmgr_ref=thread; - conn_private->is_fisrt_read=1; + conn_private->is_first_read=1; conn_public=&(conn_private->head); addr_sock2layer(conn_public->downstream.addr,peeraddr,peeraddrlen); thread->stat.value[STREAM_NUM]++;