@@ -38,9 +38,9 @@ Http2Plugin *http2_plugin()
|
|||||||
int
|
int
|
||||||
http2_header_str_to_val(const char *str, const char * map[], unsigned int map_size)
|
http2_header_str_to_val(const char *str, const char * map[], unsigned int map_size)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 1; i < map_size; i++)
|
for (unsigned int i = 2; i < map_size; i++)
|
||||||
{
|
{
|
||||||
if (!strncasecmp(str, map[i], strlen(map[i])))
|
if ( (strlen(str) == strlen(map[i])) && !strncasecmp(str, map[i], strlen(map[i])))
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ http2_header_str_to_val(const char *str, const char * map[], unsigned int map_si
|
|||||||
|
|
||||||
// in http [TFE_HTTP_UNKNOWN_FIELD] = NULL; [TFE_HTTP_HOST] = "Host",
|
// in http [TFE_HTTP_UNKNOWN_FIELD] = NULL; [TFE_HTTP_HOST] = "Host",
|
||||||
// in http2 [TFE_HTTP_UNKNOWN_FIELD] = "unknown"; [TFE_HTTP_HOST] = ":authority"
|
// in http2 [TFE_HTTP_UNKNOWN_FIELD] = "unknown"; [TFE_HTTP_HOST] = ":authority"
|
||||||
if (!strncasecmp(str, ":authority", strlen(":authority")))
|
if ( (strlen(str) == strlen(":authority")) && !strncasecmp(str, ":authority", strlen(":authority")))
|
||||||
{
|
{
|
||||||
return TFE_HTTP_HOST;
|
return TFE_HTTP_HOST;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -760,7 +760,6 @@ nghttp2_frame_submit_built_resp(struct tfe_h2_stream *h2_stream_info,
|
|||||||
if (rv != 0){
|
if (rv != 0){
|
||||||
return ACTION_FORWARD_DATA;
|
return ACTION_FORWARD_DATA;
|
||||||
}
|
}
|
||||||
delete_nv_packet_data(h2_header);
|
|
||||||
|
|
||||||
return ACTION_DROP_DATA;
|
return ACTION_DROP_DATA;
|
||||||
}
|
}
|
||||||
@@ -805,7 +804,6 @@ nghttp2_frame_submit_built_req(struct tfe_h2_stream *h2_stream_info,
|
|||||||
nghttp2_strerror(stream_id));
|
nghttp2_strerror(stream_id));
|
||||||
return ACTION_FORWARD_DATA;
|
return ACTION_FORWARD_DATA;
|
||||||
}
|
}
|
||||||
delete_nv_packet_data(h2_header);
|
|
||||||
|
|
||||||
return ACTION_DROP_DATA;
|
return ACTION_DROP_DATA;
|
||||||
}
|
}
|
||||||
@@ -1195,7 +1193,6 @@ nghttp2_submit_header_by_not_modify(struct tfe_h2_stream *h2_stream_info,
|
|||||||
printf("Fatal headers error: %s\n", nghttp2_strerror(stream_id));
|
printf("Fatal headers error: %s\n", nghttp2_strerror(stream_id));
|
||||||
stream_action = ACTION_FORWARD_DATA;
|
stream_action = ACTION_FORWARD_DATA;
|
||||||
}
|
}
|
||||||
delete_nv_packet_data(&headers);
|
|
||||||
|
|
||||||
if (stream_action == ACTION_DROP_DATA){
|
if (stream_action == ACTION_DROP_DATA){
|
||||||
xret = nghttp2_session_send(h2_stream_info->as_server);
|
xret = nghttp2_session_send(h2_stream_info->as_server);
|
||||||
@@ -1385,7 +1382,6 @@ nghttp2_server_frame_submit_push_promise(struct tfe_h2_stream *h2_stream_info,
|
|||||||
}
|
}
|
||||||
upstream_create_req(h2_stream_info, h2_stream_info->as_server, peer_h2_stream, stream_id);
|
upstream_create_req(h2_stream_info, h2_stream_info->as_server, peer_h2_stream, stream_id);
|
||||||
/*clean header message **/
|
/*clean header message **/
|
||||||
delete_nv_packet_data(headers);
|
|
||||||
stream_action = ACTION_DROP_DATA;
|
stream_action = ACTION_DROP_DATA;
|
||||||
finish:
|
finish:
|
||||||
return stream_action;
|
return stream_action;
|
||||||
@@ -1594,7 +1590,6 @@ nghttp2_server_frame_submit_header(struct tfe_h2_stream *h2_stream_info,
|
|||||||
if (xret < 0){
|
if (xret < 0){
|
||||||
printf("Fatal headers error: %s\n", nghttp2_strerror(xret));
|
printf("Fatal headers error: %s\n", nghttp2_strerror(xret));
|
||||||
}
|
}
|
||||||
delete_nv_packet_data(headers);
|
|
||||||
|
|
||||||
return stream_action;
|
return stream_action;
|
||||||
}
|
}
|
||||||
@@ -1778,7 +1773,6 @@ nghttp2_client_frame_submit_header(struct tfe_h2_stream *h2_stream_info,
|
|||||||
}
|
}
|
||||||
stream_action = ACTION_DROP_DATA;
|
stream_action = ACTION_DROP_DATA;
|
||||||
finish:
|
finish:
|
||||||
delete_nv_packet_data(headers);
|
|
||||||
return stream_action;
|
return stream_action;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1874,7 +1868,7 @@ nghttp2_fill_up_header(nghttp2_session *ngh2_session, const nghttp2_frame *frame
|
|||||||
TFE_LOG_ERROR(logger()->handle, "Header stream id %d, can't find stream information",
|
TFE_LOG_ERROR(logger()->handle, "Header stream id %d, can't find stream information",
|
||||||
frame->hd.stream_id);
|
frame->hd.stream_id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
struct tfe_h2_half_private *half = (dir == CONN_DIR_UPSTREAM) ? h2_session->resp : h2_session->req;
|
struct tfe_h2_half_private *half = (dir == CONN_DIR_UPSTREAM) ? h2_session->resp : h2_session->req;
|
||||||
|
|
||||||
struct http_field_name field;
|
struct http_field_name field;
|
||||||
|
|||||||
Reference in New Issue
Block a user