diff --git a/lib/service.c b/lib/service.c index fb6ebb725..fde3ccd77 100644 --- a/lib/service.c +++ b/lib/service.c @@ -490,11 +490,12 @@ libwebsocket_service_fd(struct libwebsocket_context *context, n = lws_server_socket_service(context, wsi, pollfd); if (n < 0) goto close_and_handled; - if( lws_ssl_pending(wsi) ) { + pending = lws_ssl_pending(wsi); + if( pending ) { goto handle_pending; } else { - goto handled; + goto handled; }; case LWS_CONNMODE_WS_SERVING: @@ -590,8 +591,8 @@ drain: eff_buf.token_len = 0; } while (more); -handle_pending: pending = lws_ssl_pending(wsi); +handle_pending: if (pending) { pending = pending > sizeof(context->service_buffer)? sizeof(context->service_buffer):pending;