cgi: avoid spin on php
authorAndy Green <andy@warmcat.com>
Wed, 22 Mar 2017 12:15:01 +0000 (20:15 +0800)
committerAndy Green <andy@warmcat.com>
Wed, 22 Mar 2017 13:24:04 +0000 (21:24 +0800)
lib/service.c

index 82e379a..c7bb06f 100644 (file)
@@ -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)