trac82 consistently use CONTEXT_PORT_NO_LISTEN
authorAndy Green <andy.green@linaro.org>
Thu, 31 Jul 2014 01:44:00 +0000 (09:44 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 31 Jul 2014 01:44:00 +0000 (09:44 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/context.c
lib/libwebsockets.h

index ebd0e1a..635bb13 100644 (file)
@@ -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;
index ea40fa1..a3ed207 100644 (file)
@@ -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-