1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

api make close api private only

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-02-12 10:19:08 +08:00
parent 70edd6fb80
commit 508946cefd
4 changed files with 10 additions and 6 deletions

View file

@ -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
------------

View 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);

View 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,

View 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;