修改key_keeper请求为post

修改key_keeper请求连接为长连接
修改HTTP2流id设置时机
This commit is contained in:
fengweihao
2019-09-16 14:01:14 +08:00
parent 8baa823231
commit 4b0235d199
10 changed files with 55 additions and 45 deletions

View File

@@ -831,6 +831,7 @@ nghttp2_frame_submit_built_req(struct tfe_h2_stream *h2_stream_info,
nghttp2_nv hdrs[h2_header->nvlen];
/*Adapt Http uri Settings**/
nghttp2_session_set_next_stream_id(h2_stream_info->as_client, h2_session->ngh2_stream_id);
stream_id = nghttp2_submit_request(h2_stream_info->as_client, NULL,
tfe_h2_header_modify_field(h2_header, hdrs, ":path", plugin_built_req->url_storage),
h2_header->nvlen, &data_prd, h2_session);
@@ -1626,8 +1627,8 @@ nghttp2_server_frame_submit_header(struct tfe_h2_stream *h2_stream_info,
}
nghttp2_nv hdrs[headers->nvlen];
xret = nghttp2_submit_headers(h2_stream_info->as_server, headers->flag,
h2_session->ngh2_stream_id, NULL, tfe_h2_header_convert_nv(headers, hdrs),
headers->nvlen, h2_session);
h2_session->ngh2_stream_id, NULL, tfe_h2_header_convert_nv(headers, hdrs),
headers->nvlen, h2_session);
if (xret < 0){
printf("Fatal headers error: %s\n", nghttp2_strerror(xret));
}
@@ -1780,8 +1781,6 @@ nghttp2_client_frame_submit_header(struct tfe_h2_stream *h2_stream_info,
downstream_create_resp(h2_session, h2_stream_info->as_client, h2_stream_info->as_server,
h2_stream_info->tf_stream, h2_stream_info->thread_id);
/*Adapt inconsistent client and server stream ids ***/
nghttp2_session_set_next_stream_id(h2_stream_info->as_client, h2_session->ngh2_stream_id);
if (h2_session->plugin_built_resp)
{
stream_action = nghttp2_submit_built_response(h2_stream_info, h2_session);
@@ -1802,10 +1801,13 @@ nghttp2_client_frame_submit_header(struct tfe_h2_stream *h2_stream_info,
return stream_action;
}
}
nghttp2_nv hdrs[headers->nvlen];
nghttp2_nv hdrs[headers->nvlen];
/**Register the stream id as -1 and read the next stream id */
nghttp2_session_set_next_stream_id(h2_stream_info->as_client, h2_session->ngh2_stream_id);
stream_id = nghttp2_submit_headers(h2_stream_info->as_client, headers->flag,
-1, NULL, tfe_h2_header_modify_field(headers, hdrs, ":path", req->url_storage),
-1, NULL, tfe_h2_header_modify_field(headers, hdrs, ":path", req->url_storage),
headers->nvlen, h2_session);
if (stream_id < 0){
TFE_LOG_ERROR(logger()->handle, "Could not submit request: %s",
nghttp2_strerror(stream_id));
@@ -1837,7 +1839,7 @@ nghttp2_client_submit_header(struct tfe_h2_stream *h2_stream_info, int32_t strea
req = h2_session->req;
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;
//h2_stream_info->as_client->last_sent_stream_id = MIN(h2_stream_info->as_client->last_sent_stream_id, stream_id) - 1;
req->event_cb(req, EV_HTTP_REQ_HDR, NULL, 0, req->event_cb_user);