stop being so fragile on socket lifecycle 20/2820/1
authorAndy Green <andy.green@linaro.org>
Sun, 7 Oct 2012 12:40:35 +0000 (20:40 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:20 +0000 (13:01 -0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.c

index 03147e1..2f5b4d0 100644 (file)
@@ -1508,7 +1508,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
        wsi = wsi_from_fd(context, pollfd->fd);
 
        if (wsi == NULL)
-               return 1;
+               return 0;
 
        switch (wsi->mode) {
        case LWS_CONNMODE_SERVER_LISTENER:
@@ -2001,7 +2001,7 @@ bail3:
                if (!eff_buf.token_len) {
                        libwebsocket_close_and_free_session(context, wsi,
                                                    LWS_CLOSE_STATUS_NOSTATUS);
-                       return 1;
+                       return 0;
                }
 
                /*