1.删除缓存测试无效代码
2.修改header链表结构为TQ 3,重构h2_half_ops_field_read,h2_half_ops_field_write等接口
This commit is contained in:
@@ -61,8 +61,8 @@ void load_logging_conf(const char *config)
|
||||
|
||||
UNUSED static void http2_plugin_timer_gc_cb(evutil_socket_t fd, short what, void * arg)
|
||||
{
|
||||
struct tfe_session_info_t *session_info = (struct tfe_session_info_t *)arg;
|
||||
sess_data_ctx_fini(session_info, NULL, session_info->thread_id);
|
||||
struct tfe_h2_stream *h2_stream_info = (struct tfe_h2_stream *)arg;
|
||||
sess_data_ctx_fini(h2_stream_info, NULL, h2_stream_info->thread_id);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -76,15 +76,15 @@ http2_plugin_init(struct tfe_proxy * proxy)
|
||||
|
||||
for (unsigned int thread_id = 0; thread_id < thread_nu; thread_id++){
|
||||
#if 0
|
||||
struct tfe_session_info_t session_info = plugin->session_info[thread_id];
|
||||
TAILQ_INIT(&(session_info.list));
|
||||
session_info.thread_id = thread_id;
|
||||
session_info.as_client = 0;
|
||||
struct tfe_session_info_t h2_stream_info = plugin->h2_stream_info[thread_id];
|
||||
TAILQ_INIT(&(h2_stream_info.list));
|
||||
h2_stream_info.thread_id = thread_id;
|
||||
h2_stream_info.as_client = 0;
|
||||
|
||||
struct event_base * ev_base = tfe_proxy_get_work_thread_evbase(thread_id);
|
||||
|
||||
struct timeval timer = {0, 500 * 1000};
|
||||
struct event * event = event_new(ev_base, -1, EV_PERSIST, http2_plugin_timer_gc_cb, &session_info);
|
||||
struct event * event = event_new(ev_base, -1, EV_PERSIST, http2_plugin_timer_gc_cb, &h2_stream_info);
|
||||
|
||||
if (unlikely(event == NULL)){
|
||||
TFE_LOG_ERROR(logger()->handle, "Create timer error, init failed!");
|
||||
@@ -113,7 +113,7 @@ http2_stream_open(const struct tfe_stream *stream, unsigned int thread_id,
|
||||
|
||||
memset(tapinfo, 0, sizeof(struct stream_tap_info_t));
|
||||
tapinfo->preempted = 0;
|
||||
tapinfo->session_info = tfe_session_info_init();
|
||||
tapinfo->h2_stream_info = tfe_session_info_init();
|
||||
|
||||
*pme = (void *)tapinfo;
|
||||
|
||||
@@ -180,8 +180,8 @@ http2_stream_data(const struct tfe_stream * stream, unsigned int thread_id,
|
||||
tapinfo->preempted = 1;
|
||||
}
|
||||
|
||||
return (dir == CONN_DIR_DOWNSTREAM) ? detect_down_stream_protocol(tapinfo->session_info, stream, thread_id,
|
||||
data, len) : detect_up_stream_protocol(tapinfo->session_info, stream, thread_id, data, len);
|
||||
return (dir == CONN_DIR_DOWNSTREAM) ? detect_down_stream_protocol(tapinfo->h2_stream_info, stream, thread_id,
|
||||
data, len) : detect_up_stream_protocol(tapinfo->h2_stream_info, stream, thread_id, data, len);
|
||||
|
||||
detach:
|
||||
tfe_stream_detach(stream);
|
||||
@@ -195,10 +195,10 @@ http2_stream_close(const struct tfe_stream * stream, unsigned int thread_id,
|
||||
{
|
||||
struct stream_tap_info_t *tapinfo = (struct stream_tap_info_t *)(*pme);
|
||||
|
||||
sess_data_ctx_fini(tapinfo->session_info, stream, thread_id);
|
||||
sess_data_ctx_fini(tapinfo->h2_stream_info, stream, thread_id);
|
||||
|
||||
free(tapinfo->session_info);
|
||||
tapinfo->session_info = NULL;
|
||||
free(tapinfo->h2_stream_info);
|
||||
tapinfo->h2_stream_info = NULL;
|
||||
|
||||
free(tapinfo);
|
||||
tapinfo = NULL;
|
||||
@@ -213,7 +213,7 @@ static struct tfe_plugin __nghttp2_plugin_info =
|
||||
.symbol = "HTTP2",
|
||||
.type = TFE_PLUGIN_TYPE_PROTOCOL,
|
||||
.on_init = http2_plugin_init,
|
||||
.on_deinit = http2_plugin_deinit,
|
||||
.on_deinit = http2_plugin_deinit,
|
||||
.on_open = http2_stream_open,
|
||||
.on_data = http2_stream_data,
|
||||
.on_close = http2_stream_close
|
||||
|
||||
Reference in New Issue
Block a user