From 67f94599d2e383687f6615b4822907133e590d5e Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 31 Jul 2014 09:44:00 +0800 Subject: [PATCH] trac82 consistently use CONTEXT_PORT_NO_LISTEN Signed-off-by: Andy Green --- lib/context.c | 2 +- lib/libwebsockets.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/context.c b/lib/context.c index ebd0e1a..635bb13 100644 --- a/lib/context.c +++ b/lib/context.c @@ -310,7 +310,7 @@ libwebsocket_context_destroy(struct libwebsocket_context *context) * give all extensions a chance to clean up any per-context * allocations they might have made */ - if (context->listen_port) { + if (context->listen_port != CONTEXT_PORT_NO_LISTEN) { if (lws_ext_callback_for_each_extension_type(context, NULL, LWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT, NULL, 0) < 0) return; diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index ea40fa1..a3ed207 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -913,9 +913,10 @@ struct libwebsocket_extension { /** * struct lws_context_creation_info: parameters to create context with * - * @port: Port to listen on... you can use 0 to suppress listening on - * any port, that's what you want if you are not running a - * websocket server at all but just using it as a client + * @port: Port to listen on... you can use CONTEXT_PORT_NO_LISTEN to + * suppress listening on any port, that's what you want if you are + * not running a websocket server at all but just using it as a + * client * @iface: NULL to bind the listen socket to all interfaces, or the * interface name, eg, "eth2" * @protocols: Array of structures listing supported protocols and a protocol- -- 2.7.4