client check cb return during establish
authorAndy Green <andy.green@linaro.org>
Thu, 17 Dec 2015 16:50:14 +0000 (00:50 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 17 Dec 2015 16:50:14 +0000 (00:50 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/client.c

index bcae51c..d9a1af3 100644 (file)
@@ -718,9 +718,10 @@ check_accept:
         * we seem to be good to go, give client last chance to check
         * headers and OK it
         */
-       wsi->protocol->callback(wsi,
-                               LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH,
-                               wsi->user_space, NULL, 0);
+       if (wsi->protocol->callback(wsi,
+                                   LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH,
+                                   wsi->user_space, NULL, 0))
+               goto bail2;
 
        /* clear his proxy connection timeout */
 
@@ -762,8 +763,9 @@ check_accept:
 
        /* call him back to inform him he is up */
 
-       wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_ESTABLISHED,
-                               wsi->user_space, NULL, 0);
+       if (wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_ESTABLISHED,
+                                   wsi->user_space, NULL, 0))
+               goto bail3;
 #ifndef LWS_NO_EXTENSIONS
        /*
         * inform all extensions, not just active ones since they