summaryrefslogtreecommitdiff
path: root/plugin/protocol/http2/src/http2_stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/protocol/http2/src/http2_stream.cpp')
-rw-r--r--plugin/protocol/http2/src/http2_stream.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp
index a8a89fc..a722eb8 100644
--- a/plugin/protocol/http2/src/http2_stream.cpp
+++ b/plugin/protocol/http2/src/http2_stream.cpp
@@ -1658,8 +1658,16 @@ static void fill_req_spec_from_handle(struct tfe_h2_half_private *half_private)
}
}
char *urltmp = ALLOC(char, urllen + 1);
- if(urltmp){
- sprintf(urltmp, "%s%s", (char *)req_spec->host, (char *)req_spec->uri);
+ if(urltmp)
+ {
+ if(req_spec->host != NULL && req_spec->uri == NULL)
+ {
+ sprintf(urltmp, "%s", (char *)req_spec->host);
+ }
+ if(req_spec->host != NULL && req_spec->uri != NULL)
+ {
+ sprintf(urltmp, "%s%s", (char *)req_spec->host, (char *)req_spec->uri);
+ }
req_spec->url = urltmp;
}
return;
@@ -1784,6 +1792,12 @@ static int http2_client_submit_header(struct tfe_h2_stream *h2_stream_info, int3
fill_req_spec_from_handle(h2_session->req);
//h2_stream_info->as_client->last_sent_stream_id = MIN(h2_stream_info->as_client->last_sent_stream_id, stream_id) - 1;
+ if(req->half_public.req_spec.method == TFE_HTTP_METHOD_CONNECT)
+ {
+ stream_action = ACTION_FORWARD_DATA;
+ goto finish;
+ }
+
req->event_cb(req, EV_HTTP_REQ_HDR, NULL, 0, req->event_cb_user);
// int googletest, h2_stream_info->tf_stream is NULL
@@ -2415,7 +2429,9 @@ static int http2_server_on_data_chunk_recv(nghttp2_session *session, uint8_t fla
data = input;
len = input_len;
/*todo post data scan**/
- if (req->body_state == H2_READ_STATE_BEGIN){
+
+ if (req->body_state == H2_READ_STATE_BEGIN)
+ {
if (req->event_cb)
{
req->event_cb(req, EV_HTTP_REQ_BODY_BEGIN, NULL, len,