diff options
author | Andy Green <andy.green@linaro.org> | 2015-12-16 18:19:08 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2015-12-16 18:19:08 +0800 |
commit | 11c05bfa09a0d4a71588a6eb8d03aba5e1c48e59 (patch) | |
tree | c96a4cd99f013be7c014a322b0c38166c8335f36 /changelog | |
parent | 8a97c06cd1a5aa24535cbdbc959500754dd1810e (diff) | |
download | libwebsockets-11c05bfa09a0d4a71588a6eb8d03aba5e1c48e59.tar.gz libwebsockets-11c05bfa09a0d4a71588a6eb8d03aba5e1c48e59.tar.bz2 libwebsockets-11c05bfa09a0d4a71588a6eb8d03aba5e1c48e59.zip |
public api remove superfluous context params API BREAK
Extend the cleanout caused by wsi having a context pointer
into the public api.
There's no point keeping the 1.5 compatibility work,
we have changed the api in several places and
rebuilt wasn't going to be enough a while ago.
Signed-off-by: Andy Green <andy.green@linaro.org>
Diffstat (limited to 'changelog')
-rw-r--r-- | changelog | 74 |
1 files changed, 62 insertions, 12 deletions
@@ -60,23 +60,73 @@ The reason for this change is struct lws_protocols has been changed to remove members that lws used for private storage: so the protocols struct in now truly const and may be reused serially or simultaneously by different contexts. -2) Several older apis start with libwebsocket_ or libwebsockets_ while newer ones -all begin lws_. These apis have been changed to all begin with lws_. +2) Eleven APIs -However except for the three APIs mentioned above in 1), compatibility defines -have been added in libwebsockets.h, so it is largely build-compatible with -older sources using the old api names. +LWS_VISIBLE LWS_EXTERN int +lws_add_http_header_by_name(struct lws_context *context, + struct lws *wsi, + const unsigned char *name, + const unsigned char *value, + int length, + unsigned char **p, + unsigned char *end); +LWS_VISIBLE LWS_EXTERN int +lws_finalize_http_header(struct lws_context *context, + struct lws *wsi, + unsigned char **p, + unsigned char *end); +LWS_VISIBLE LWS_EXTERN int +lws_add_http_header_by_token(struct lws_context *context, + struct lws *wsi, + enum lws_token_indexes token, + const unsigned char *value, + int length, + unsigned char **p, + unsigned char *end); +LWS_VISIBLE LWS_EXTERN int +lws_add_http_header_content_length(struct lws_context *context, + struct lws *wsi, + unsigned long content_length, + unsigned char **p, + unsigned char *end); +LWS_VISIBLE LWS_EXTERN int +lws_add_http_header_status(struct lws_context *context, struct lws *wsi, + unsigned int code, unsigned char **p, + unsigned char *end); -If you are using lws with a distro, or otherwise can't rebuild the user code, -you should add +LWS_VISIBLE LWS_EXTERN int +lws_serve_http_file(struct lws_context *context, struct lws *wsi, + const char *file, const char *content_type, + const char *other_headers, int other_headers_len); +LWS_VISIBLE LWS_EXTERN int +lws_serve_http_file_fragment(struct lws_context *context, struct lws *wsi); - -DLWS_WITH_OLD_API_WRAPPERS=1 +LWS_VISIBLE LWS_EXTERN int +lws_return_http_status(struct lws_context *context, struct lws *wsi, + unsigned int code, const char *html_body); + +LWS_VISIBLE LWS_EXTERN int +lws_callback_on_writable(const struct lws_context *context, struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN void +lws_get_peer_addresses(struct lws_context *context, struct lws *wsi, + lws_sockfd_type fd, char *name, int name_len, + char *rip, int rip_len); + +LWS_VISIBLE LWS_EXTERN int +lws_read(struct lws_context *context, struct lws *wsi, + unsigned char *buf, size_t len); + +no longer require their initial struct lws_context * parameter. + +3) Several older apis start with libwebsocket_ or libwebsockets_ while newer ones +all begin lws_. These apis have been changed to all begin with lws_. -to your cmake args. This builds lws with all the old apis as wrappers around -the new apis, so the library still exports the old apis. +To convert, search-replace -In this way you can have lws export both the new and old apis simultaneously -for compatibility. + - libwebsockets_/lws_ + - libwebsocket_/lws_ + - struct\ libwebsocket/struct\ lws v1.5-chrome47-firefox41 |