1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

content_length zero: client

https://github.com/warmcat/libwebsockets/issues/1337
This commit is contained in:
ecionis 2018-07-21 10:26:47 +08:00 committed by Andy Green
parent 7019b56ec9
commit d573a06eb6

View file

@ -954,6 +954,15 @@ lws_client_interpret_server_handshake(struct lws *wsi)
lwsl_info("%s: client connection up\n", __func__);
/*
* Did we get a response from the server with an explicit
* content-length of zero? If so, this transaction is already
* completed at the end of the header processing...
*/
if (lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH) &&
!wsi->http.rx_content_length)
return !!lws_http_transaction_completed_client(wsi);
return 0;
}