From 49036d571f23ab9b03d6440ba5709d994782ed39 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 22 Mar 2017 20:15:01 +0800 Subject: [PATCH] cgi: avoid spin on php --- lib/service.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/service.c b/lib/service.c index 82e379a..c7bb06f 100644 --- a/lib/service.c +++ b/lib/service.c @@ -110,8 +110,15 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd) #endif #ifdef LWS_WITH_CGI - if (wsi->cgi) + if (wsi->cgi) { + /* also one shot */ + if (pollfd) + if (lws_change_pollfd(wsi, LWS_POLLOUT, 0)) { + lwsl_info("failed at set pollfd\n"); + return 1; + } goto user_service_go_again; + } #endif /* Priority 3: pending control packets (pong or close) -- 2.7.4