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))
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) {
}
}
- 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;
}
unsigned int END_STREAM:1;
unsigned int END_HEADERS:1;
+ unsigned int send_END_STREAM:1;
/* hpack */
enum http2_hpack_state hpack;