diff options
Diffstat (limited to 'plugin/protocol/http2/src/http2_stream.cpp')
| -rw-r--r-- | plugin/protocol/http2/src/http2_stream.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp index 30eaa25..7514279 100644 --- a/plugin/protocol/http2/src/http2_stream.cpp +++ b/plugin/protocol/http2/src/http2_stream.cpp @@ -387,7 +387,7 @@ h2_half_ops_append_body(struct tfe_http_half * half, char * buff, size_t size, i struct tfe_h2_half_private * resp = nghttp2_to_half_private(half); struct tfe_h2_payload *body = &resp->h2_payload; - if (buff == NULL && size == 0){ + if (buff == NULL || size == 0){ if (body->gzip != HTTP2_CONTENT_ENCODING_NONE){ xret = deflate_write(&body->deflate, NULL, 0, resp->h2_payload.evbuf_body, body->gzip, 1); } @@ -661,6 +661,10 @@ upstream_read_callback(nghttp2_session *session, int32_t stream_id, if (!to_send_body->evbuf_body || !(input = evbuffer_pullup(to_send_body->evbuf_body, -1)) || 0==(inputlen = evbuffer_get_length(to_send_body->evbuf_body))) { + if ((to_send_body->flags & NGHTTP2_FLAG_END_STREAM) == 0) + { + *data_flags |= NGHTTP2_DATA_FLAG_NO_END_STREAM; + } *data_flags |= NGHTTP2_DATA_FLAG_EOF; return 0; } @@ -689,6 +693,7 @@ nghttp2_server_frame_submit_response(struct tfe_h2_stream *h2_stream_info, return ACTION_FORWARD_DATA; struct tfe_h2_payload *body = &pangu_resp->h2_payload; + body->flags |= NGHTTP2_FLAG_END_STREAM; char str_sz_evbuf_body[TFE_STRING_MAX]; snprintf(str_sz_evbuf_body, sizeof(str_sz_evbuf_body) - 1, "%lu", evbuffer_get_length(body->evbuf_body)); |
