* 集成HTTP Parser,解析HTTP请求侧数据; * 增加tfe_http.h中请求方法、应答状态的常量定义 * 变更tfe_http.h中HTTP头部标准定义,去掉非头部字段,增加TFE前缀避免冲突。
19 lines
612 B
C
19 lines
612 B
C
#pragma once
|
|
|
|
struct http_half_private * hf_private_create(tfe_http_direction ht_dir, short major, short minor);
|
|
void hf_private_destory(struct http_half_private * hf_private);
|
|
|
|
/** Parse the raw tcp input for HTTP half structure
|
|
* @param hf_private
|
|
* hf_private handler.
|
|
* @param data
|
|
* raw tcp data, used in the stream's callback.
|
|
* @param len
|
|
* raw tcp data length.
|
|
* @return
|
|
* 0 for need more data,
|
|
* 1 for reach the boundary, need to call http business callbacks,
|
|
* -1 for error.
|
|
*/
|
|
int hf_private_parse(struct http_half_private * hf_private, const unsigned char * data, size_t len);
|