From da46eeea6b63a92454a5f56d7f46003fb16a7aea Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 18 Dec 2015 00:50:14 +0800 Subject: [PATCH] client check cb return during establish Signed-off-by: Andy Green --- lib/client.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/client.c b/lib/client.c index bcae51cff..d9a1af378 100644 --- a/lib/client.c +++ b/lib/client.c @@ -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