windows align lws_service_fd return processing with unix
authorAndy Green <andy.green@linaro.org>
Sat, 5 Dec 2015 01:38:50 +0000 (09:38 +0800)
committerAndy Green <andy.green@linaro.org>
Sat, 5 Dec 2015 01:38:50 +0000 (09:38 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/lws-plat-win.c

index 9ed6528..5176f1c 100644 (file)
@@ -164,7 +164,10 @@ lws_plat_service(struct lws_context *context, int timeout_ms)
                        pfd->revents = LWS_POLLOUT;
                        n = lws_service_fd(context, pfd);
                        if (n < 0)
-                               return n;
+                               return -1;
+                       /* if something closed, retry this slot */
+                       if (n)
+                               i--;
                }
        }