api make close api private only 82/3082/1
authorAndy Green <andy.green@linaro.org>
Tue, 12 Feb 2013 02:19:08 +0000 (10:19 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:34 +0000 (13:01 -0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
changelog
lib/libwebsockets.h
lib/private-libwebsockets.h
test-server/test-server.c

index 19db24a..f69fc12 100644 (file)
--- a/changelog
+++ b/changelog
@@ -82,6 +82,11 @@ User api removals
        connection you must do so from the user callback and by returning
        -1 from there.
 
+ - libwebsocket_close_and_free_session() is now private to the library code
+       only and not exposed for user code.  If you want to close the
+       connection, you must do so from the user callback by returning -1
+       from there.
+
 
 New features
 ------------
index db95fe8..9a59032 100644 (file)
@@ -917,10 +917,6 @@ libwebsockets_get_peer_addresses(struct libwebsocket_context *context,
                struct libwebsocket *wsi, int fd, char *name, int name_len,
                                        char *rip, int rip_len);
 
-LWS_EXTERN void
-libwebsocket_close_and_free_session(struct libwebsocket_context *context,
-                              struct libwebsocket *wsi, enum lws_close_status);
-
 LWS_EXTERN int
 libwebsockets_get_random(struct libwebsocket_context *context,
                                                            void *buf, int len);
index d93621d..f98d3fd 100644 (file)
@@ -401,6 +401,10 @@ struct libwebsocket {
 #endif
 };
 
+extern void
+libwebsocket_close_and_free_session(struct libwebsocket_context *context,
+                              struct libwebsocket *wsi, enum lws_close_status);
+
 #ifndef LWS_LATENCY
 static inline void lws_latency(struct libwebsocket_context *context,
                struct libwebsocket *wsi, const char *action,
index 862124d..1ccffc4 100644 (file)
@@ -287,8 +287,7 @@ callback_dumb_increment(struct libwebsocket_context *context,
                }
                if (close_testing && pss->number == 50) {
                        lwsl_info("close tesing limit, closing\n");
-                       libwebsocket_close_and_free_session(context, wsi,
-                                                      LWS_CLOSE_STATUS_NORMAL);
+                       return -1;
                }
                break;