*由于git rebase冲突删除原tfe-new-http2分支
*提交包括http2数据替换,转发,截断,缓存代码 *合并最新develop-tfe3a后,http2验证代码提交 *http2重构验证代码提交 *http2添加br压缩解压缩接口和测试用例 *http2定时删除session信息代码提交 *修复bug,访问二级链接时由于nghttp2库收到control ping后,自发control ping包 造成链接断开后重连现象 *修复bug, 链接建立后服务端优先发送control包,未处理此数据包,造成页面访问失败
This commit is contained in:
85
plugin/protocol/http2/include/internal/http2_common.h
Normal file
85
plugin/protocol/http2/include/internal/http2_common.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/*************************************************************************
|
||||
> File Name: http2_common.h
|
||||
> Author:
|
||||
> Mail:
|
||||
> Created Time: 2018年09月21日 星期五 13时59分12秒
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _HTTP2_STRING_H
|
||||
#define _HTTP2_STRING_H
|
||||
|
||||
#include <zlib.h>
|
||||
#include <sys/queue.h>
|
||||
#include <brotli/encode.h>
|
||||
#include <brotli/decode.h>
|
||||
#include <http2_stream.h>
|
||||
|
||||
typedef struct RTLogInit2Data_ {
|
||||
int run_log_level;
|
||||
|
||||
char run_log_path[256];
|
||||
|
||||
void *run_log_handle;
|
||||
} RTLogInit2Data;
|
||||
|
||||
typedef struct Http2Plugin_{
|
||||
struct event * event[TFE_THREAD_MAX];
|
||||
struct tfe_session_info_t session_info[TFE_THREAD_MAX];
|
||||
} Http2Plugin;
|
||||
|
||||
typedef enum {
|
||||
NGHTTP2_METHOD_DELETE = 0,
|
||||
NGHTTP2_METHOD_GET = 1,
|
||||
NGHTTP2_METHOD_HEAD = 2,
|
||||
NGHTTP2_METHOD_POST = 3,
|
||||
NGHTTP2_METHOD_PUT = 4,
|
||||
NGHTTP2_METHOD_CONNECT = 5,
|
||||
NGHTTP2_METHOD_UNKNOWN,
|
||||
}nghttp2_method;
|
||||
|
||||
struct value_string {
|
||||
unsigned int value;
|
||||
const char *strptr;
|
||||
};
|
||||
|
||||
const char*
|
||||
val_to_str(unsigned int val, const struct value_string *vs);
|
||||
|
||||
int
|
||||
str_to_val(const char *val, const struct value_string *vs);
|
||||
|
||||
#define BV(x) (1 << x)
|
||||
#define HTTP2_CONTENT_ENCODING_NONE 0
|
||||
#define HTTP2_CONTENT_ENCODING_GZIP BV(1)
|
||||
#define HTTP2_CONTENT_ENCODING_DEFLATE BV(2)
|
||||
#define HTTP2_CONTENT_ENCODING_COMPRESS BV(3)
|
||||
#define HTTP2_CONTENT_ENCODING_BZIP2 BV(4)
|
||||
#define HTTP2_CONTENT_ENCODING_X_GZIP BV(5)
|
||||
#define HTTP2_CONTENT_ENCODING_X_BZIP2 BV(6)
|
||||
#define HTTP2_CONTENT_ENCODING_BR BV(7)
|
||||
|
||||
struct z_stream_st{
|
||||
int gip;
|
||||
z_stream zst;
|
||||
int8_t finished;
|
||||
BrotliDecoderState *brdec_state;
|
||||
BrotliEncoderState *brenc_state;
|
||||
};
|
||||
|
||||
RTLogInit2Data *rt_log_data();
|
||||
|
||||
Http2Plugin *http2_plugin();
|
||||
|
||||
int inflate_read(const uint8_t *source,int len,char **dest, int *outlen,
|
||||
struct z_stream_st **strm, int encode);
|
||||
|
||||
int deflate_write(struct z_stream_st **strm, const uint8_t *source,
|
||||
int slen, struct evbuffer * evbuf, int gzip, int end);
|
||||
|
||||
void inflate_finished(struct z_stream_st **strm);
|
||||
|
||||
void deflate_finished(struct z_stream_st **strm);
|
||||
|
||||
void frame_display(const uint8_t *payload, uint16_t payload_len);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user