mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
cgi: use transaction_complete when stdout goes away
transaction_complete includes processing for the case we are holding an output-side buflist, and arranges for it to be sent before the connection is actually closed. This stops very slow links not being ablet to use git clone via cgi mount, because the close races the flushing of the output-side buflist and in the case the connection is bad, closes before everything was sent.
This commit is contained in:
parent
b318877cd9
commit
6830f2d296
1 changed files with 6 additions and 2 deletions
|
@ -155,7 +155,9 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
LWS_WRITE_HTTP_FINAL);
|
||||
|
||||
/* always close after sending it */
|
||||
return -1;
|
||||
if (lws_http_transaction_completed(wsi))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#if defined(LWS_WITH_HTTP_PROXY)
|
||||
|
@ -462,7 +464,9 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
lws_set_timeout(wsi, PENDING_TIMEOUT_CGI, 3);
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
if (lws_http_transaction_completed(wsi))
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
case LWS_CALLBACK_CGI_STDIN_DATA: /* POST body for stdin */
|
||||
args = (struct lws_cgi_args *)in;
|
||||
|
|
Loading…
Add table
Reference in a new issue