http2 dont use incoming END_STREAM when sending headers
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
260a0fce54
commit
1cea5816fa
3 changed files with 5 additions and 3 deletions
|
@ -668,8 +668,7 @@ int lws_add_http2_header_status(struct libwebsocket_context *context,
|
|||
unsigned char status[10];
|
||||
int n;
|
||||
|
||||
if (code >= 400)
|
||||
wsi->u.http2.END_STREAM = 1;
|
||||
wsi->u.http2.send_END_STREAM = !!(code >= 400);
|
||||
|
||||
n = sprintf((char *)status, "%u", code);
|
||||
if (lws_add_http2_header_by_token(context, wsi, WSI_TOKEN_HTTP_COLON_STATUS, status, n, p, end))
|
||||
|
|
|
@ -445,6 +445,8 @@ send_raw:
|
|||
if (protocol == LWS_WRITE_HTTP_HEADERS) {
|
||||
n = LWS_HTTP2_FRAME_TYPE_HEADERS;
|
||||
flags = LWS_HTTP2_FLAG_END_HEADERS;
|
||||
if (wsi->u.http2.send_END_STREAM)
|
||||
flags |= LWS_HTTP2_FLAG_END_STREAM;
|
||||
}
|
||||
|
||||
if ((protocol == LWS_WRITE_HTTP || protocol == LWS_WRITE_HTTP_FINAL) && wsi->u.http.content_length) {
|
||||
|
@ -456,7 +458,7 @@ send_raw:
|
|||
}
|
||||
}
|
||||
|
||||
if ((protocol == LWS_WRITE_HTTP_FINAL || protocol == LWS_WRITE_HTTP_HEADERS) && wsi->u.http2.END_STREAM) {
|
||||
if (protocol == LWS_WRITE_HTTP_FINAL && wsi->u.http2.END_STREAM) {
|
||||
lwsl_info("%s: setting END_STREAM\n", __func__);
|
||||
flags |= LWS_HTTP2_FLAG_END_STREAM;
|
||||
}
|
||||
|
|
|
@ -699,6 +699,7 @@ struct _lws_http2_related {
|
|||
|
||||
unsigned int END_STREAM:1;
|
||||
unsigned int END_HEADERS:1;
|
||||
unsigned int send_END_STREAM:1;
|
||||
|
||||
/* hpack */
|
||||
enum http2_hpack_state hpack;
|
||||
|
|
Loading…
Add table
Reference in a new issue