Skip to content
Snippets Groups Projects
Commit 51a1b5eb authored by Andy Green's avatar Andy Green
Browse files

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.
parent a6182ae6
Branches
No related tags found
No related merge requests found
...@@ -155,7 +155,9 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, ...@@ -155,7 +155,9 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
LWS_WRITE_HTTP_FINAL); LWS_WRITE_HTTP_FINAL);
/* always close after sending it */ /* always close after sending it */
return -1; if (lws_http_transaction_completed(wsi))
return -1;
return 0;
} }
#endif #endif
#if defined(LWS_WITH_HTTP_PROXY) #if defined(LWS_WITH_HTTP_PROXY)
...@@ -459,10 +461,12 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, ...@@ -459,10 +461,12 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
lwsl_debug("LWS_CALLBACK_CGI_TERMINATED: ending\n"); lwsl_debug("LWS_CALLBACK_CGI_TERMINATED: ending\n");
wsi->reason_bf |= LWS_CB_REASON_AUX_BF__CGI_CHUNK_END; wsi->reason_bf |= LWS_CB_REASON_AUX_BF__CGI_CHUNK_END;
lws_callback_on_writable(wsi); lws_callback_on_writable(wsi);
lws_set_timeout(wsi, PENDING_TIMEOUT_CGI, 3); lws_set_timeout(wsi, PENDING_TIMEOUT_CGI, 10);
break; break;
} }
return -1; if (lws_http_transaction_completed(wsi))
return -1;
return 0;
case LWS_CALLBACK_CGI_STDIN_DATA: /* POST body for stdin */ case LWS_CALLBACK_CGI_STDIN_DATA: /* POST body for stdin */
args = (struct lws_cgi_args *)in; args = (struct lws_cgi_args *)in;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment