Andy Green | a35c86f | 2013-01-31 10:16:44 +0800 | [diff] [blame] | 1 | Changelog |
| 2 | --------- |
| 3 | |
Oleh | faeac3c | 2014-07-29 23:18:41 +0800 | [diff] [blame] | 4 | (post-1.3) |
| 5 | ========== |
| 6 | |
| 7 | User api additions |
| 8 | ------------------ |
| 9 | |
| 10 | There's a new member in the info struct used to control context creation, |
| 11 | ssl_private_key_password, which allows passing into lws the passphrase on |
| 12 | an SSL cetificate |
| 13 | |
Andy Green | eabed8d | 2014-08-11 12:11:36 +0800 | [diff] [blame] | 14 | There's a new member in struct protocols, id, which is ignored by lws but can |
| 15 | be used by the user code to mark the selected protocol by user-defined version |
| 16 | or capabliity flag information, for the case multiple versions of a protocol are |
| 17 | supported. |
| 18 | |
Andy Green | b128ccc | 2014-08-16 09:54:27 +0800 | [diff] [blame] | 19 | int lws_is_ssl(wsi) added to allow user code to know if the connection was made |
| 20 | over ssl or not. If LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT is used, both |
| 21 | ssl and non-ssl connections are possible and may need to be treated differently |
| 22 | in the user code. |
| 23 | |
Andy Green | 14425ea | 2014-08-18 22:49:39 +0800 | [diff] [blame] | 24 | int lws_partial_buffered(wsi) added... should be checked after any |
| 25 | libwebsocket_write that will be followed by another libwebsocket_write inside |
| 26 | the same writeable callback. If set, you can't do any more writes until the |
| 27 | writeable callback is called again. If you only do one write per writeable callback, |
| 28 | you can ignore this. |
| 29 | |
Oleh | faeac3c | 2014-07-29 23:18:41 +0800 | [diff] [blame] | 30 | |
Andy Green | 822241c | 2014-08-18 22:21:51 +0800 | [diff] [blame] | 31 | User api removal |
| 32 | ---------------- |
| 33 | |
| 34 | protocols struct member no_buffer_all_partial_tx is removed. Under some |
| 35 | conditions like rewriting extention such as compression in use, the built-in |
| 36 | partial send buffering is the only way to deal with the problem, so turning |
| 37 | it off is deprecated. |
| 38 | |
| 39 | |
| 40 | |
Andy Green | c1fdd10 | 2014-07-06 09:56:11 +0800 | [diff] [blame] | 41 | v1.3-chrome37-firefox30 |
| 42 | ======================= |
| 43 | |
| 44 | .gitignore | 1 - |
| 45 | CMakeLists.txt | 447 +++-- |
| 46 | README.build | 35 +- |
| 47 | README.coding | 14 + |
| 48 | changelog | 66 + |
| 49 | cmake/LibwebsocketsConfig.cmake.in | 17 + |
| 50 | cmake/LibwebsocketsConfigVersion.cmake.in | 11 + |
| 51 | config.h.cmake | 18 + |
| 52 | cross-ming.cmake | 31 + |
| 53 | cross-openwrt-makefile | 91 + |
| 54 | lib/client-handshake.c | 205 ++- |
| 55 | lib/client-parser.c | 58 +- |
| 56 | lib/client.c | 158 +- |
| 57 | lib/context.c | 341 ++++ |
| 58 | lib/extension-deflate-frame.c | 2 +- |
| 59 | lib/extension.c | 178 ++ |
| 60 | lib/handshake.c | 287 +--- |
| 61 | lib/lextable.h | 338 ++++ |
| 62 | lib/libev.c | 175 ++ |
| 63 | lib/libwebsockets.c | 2089 +++-------------------- |
| 64 | lib/libwebsockets.h | 253 ++- |
| 65 | lib/lws-plat-unix.c | 404 +++++ |
| 66 | lib/lws-plat-win.c | 358 ++++ |
| 67 | lib/minilex.c | 530 +++--- |
| 68 | lib/output.c | 445 ++--- |
| 69 | lib/parsers.c | 682 ++++---- |
| 70 | lib/pollfd.c | 239 +++ |
| 71 | lib/private-libwebsockets.h | 501 +++++- |
| 72 | lib/server-handshake.c | 274 +-- |
| 73 | lib/server.c | 858 ++++++++-- |
| 74 | lib/service.c | 517 ++++++ |
| 75 | lib/sha-1.c | 38 +- |
| 76 | lib/ssl-http2.c | 78 + |
| 77 | lib/ssl.c | 571 +++++++ |
| 78 | test-server/attack.sh | 101 +- |
| 79 | test-server/test-client.c | 9 +- |
| 80 | test-server/test-echo.c | 17 +- |
| 81 | test-server/test-fraggle.c | 7 - |
| 82 | test-server/test-ping.c | 12 +- |
| 83 | test-server/test-server.c | 330 ++-- |
| 84 | test-server/test.html | 4 +- |
| 85 | win32port/client/client.vcxproj | 259 --- |
| 86 | win32port/client/client.vcxproj.filters | 39 - |
| 87 | .../libwebsocketswin32.vcxproj.filters | 93 - |
| 88 | win32port/server/server.vcxproj | 276 --- |
| 89 | win32port/server/server.vcxproj.filters | 51 - |
| 90 | win32port/win32helpers/gettimeofday.h | 59 +- |
| 91 | win32port/win32helpers/netdb.h | 1 - |
| 92 | win32port/win32helpers/strings.h | 0 |
| 93 | win32port/win32helpers/sys/time.h | 1 - |
| 94 | win32port/win32helpers/unistd.h | 0 |
| 95 | win32port/win32helpers/websock-w32.c | 104 -- |
| 96 | win32port/win32helpers/websock-w32.h | 62 - |
| 97 | win32port/win32port.sln | 100 -- |
| 98 | win32port/zlib/gzio.c | 3 +- |
| 99 | 55 files changed, 6779 insertions(+), 5059 deletions(-) |
| 100 | |
Andy Green | 7900256 | 2013-11-09 11:04:35 +0800 | [diff] [blame] | 101 | |
kapejod | ce64fb0 | 2013-11-19 13:38:16 +0100 | [diff] [blame] | 102 | User api additions |
| 103 | ------------------ |
| 104 | |
| 105 | POST method is supported |
| 106 | |
| 107 | The protocol 0 / HTTP callback can now get two new kinds of callback, |
| 108 | LWS_CALLBACK_HTTP_BODY (in and len are a chunk of the body of the HTTP request) |
| 109 | and LWS_CALLBACK_HTTP_BODY_COMPLETION (the expected amount of body has arrived |
| 110 | and been passed to the user code already). These callbacks are used with the |
| 111 | post method (see the test server for details). |
| 112 | |
| 113 | The period between the HTTP header completion and the completion of the body |
| 114 | processing is protected by a 5s timeout. |
| 115 | |
| 116 | The chunks are stored in a malloc'd buffer of size protocols[0].rx_buffer_size. |
| 117 | |
| 118 | |
James Devine | 5b34c97 | 2013-12-14 11:41:29 +0800 | [diff] [blame] | 119 | New server option you can enable from user code |
| 120 | LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT allows non-SSL connections to |
| 121 | also be accepted on an SSL listening port. It's disabled unless you enable |
| 122 | it explicitly. |
| 123 | |
| 124 | |
Andy Green | 7a13279 | 2013-12-18 09:48:26 +0800 | [diff] [blame] | 125 | Two new callbacks are added in protocols[0] that are optional for allowing |
| 126 | limited thread access to libwebsockets, LWS_CALLBACK_LOCK_POLL and |
| 127 | LWS_CALLBACK_UNLOCK_POLL. |
| 128 | |
| 129 | If you use them, they protect internal and external poll list changes, but if |
| 130 | you want to use external thread access to libwebsocket_callback_on_writable() |
| 131 | you have to implement your locking here even if you don't use external |
| 132 | poll support. |
| 133 | |
| 134 | If you will use another thread for this, take a lot of care about managing |
| 135 | your list of live wsi by doing it from ESTABLISHED and CLOSED callbacks |
| 136 | (with your own locking). |
| 137 | |
Andrew Canaday | 9769f4f | 2014-03-23 13:25:07 +0800 | [diff] [blame] | 138 | If you configure cmake with -DLWS_WITH_LIBEV=1 then the code allowing the libev |
| 139 | eventloop instead of the default poll() one will also be compiled in. But to |
| 140 | use it, you must also set the LWS_SERVER_OPTION_LIBEV flag on the context |
| 141 | creation info struct options member. |
Andy Green | 7a13279 | 2013-12-18 09:48:26 +0800 | [diff] [blame] | 142 | |
Andy Green | c1fdd10 | 2014-07-06 09:56:11 +0800 | [diff] [blame] | 143 | IPV6 is supported and enabled by default except for Windows, you can disable |
| 144 | the support at build-time by giving -DLWS_IPV6=, and disable use of it even if |
James Devine | 3f13ea2 | 2014-03-24 16:09:25 +0800 | [diff] [blame] | 145 | compiled in by making sure the flag LWS_SERVER_OPTION_DISABLE_IPV6 is set on |
| 146 | the context creation info struct options member. |
| 147 | |
Andy Green | c1fdd10 | 2014-07-06 09:56:11 +0800 | [diff] [blame] | 148 | You can give LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS option flag to |
| 149 | guarantee the OS CAs will not be used, even if that support was selected at |
| 150 | build-time. |
| 151 | |
| 152 | Optional "token limits" may be enforced by setting the member "token_limits" |
| 153 | in struct lws_context_creation_info to point to a struct lws_token_limits. |
| 154 | NULL means no token limits used for compatibility. |
| 155 | |
Andy Green | 7a13279 | 2013-12-18 09:48:26 +0800 | [diff] [blame] | 156 | |
Andy Green | 7900256 | 2013-11-09 11:04:35 +0800 | [diff] [blame] | 157 | User api changes |
| 158 | ---------------- |
| 159 | |
| 160 | Extra optional argument to libwebsockets_serve_http_file() allows injecion |
| 161 | of HTTP headers into the canned response. Eg, cookies may be added like |
| 162 | that without getting involved in having to send the header by hand. |
| 163 | |
Patrick Gansterer | 148b945 | 2014-02-28 02:31:23 +0100 | [diff] [blame] | 164 | A new info member http_proxy_address may be used at context creation time to |
| 165 | set the http proxy. If non-NULL, it overrides http_proxy environment var. |
Andy Green | 7900256 | 2013-11-09 11:04:35 +0800 | [diff] [blame] | 166 | |
Andy Green | d2ec7ad | 2014-03-15 10:39:29 +0800 | [diff] [blame] | 167 | Cmake supports LWS_SSL_CLIENT_USE_OS_CA_CERTS defaulting to on, which gets |
| 168 | the client to use the OS CA Roots. If you're worried somebody with the |
| 169 | ability to forge for force creation of a client cert from the root CA in |
| 170 | your OS, you should disable this since your selfsigned $0 cert is a lot safer |
| 171 | then... |
| 172 | |
Andy Green | 7900256 | 2013-11-09 11:04:35 +0800 | [diff] [blame] | 173 | |
Andy Green | 81877e6 | 2013-10-26 20:36:08 +0800 | [diff] [blame] | 174 | v1.23-chrome32-firefox24 |
| 175 | ======================== |
| 176 | |
| 177 | Android.mk | 29 + |
| 178 | CMakeLists.txt | 573 ++++++++---- |
| 179 | COPYING | 503 ----------- |
| 180 | INSTALL | 365 -------- |
| 181 | Makefile.am | 13 - |
| 182 | README.build | 371 ++------ |
| 183 | README.coding | 63 ++ |
| 184 | autogen.sh | 1578 --------------------------------- |
| 185 | changelog | 69 ++ |
| 186 | cmake/FindGit.cmake | 163 ++++ |
| 187 | cmake/FindOpenSSLbins.cmake | 15 +- |
| 188 | cmake/UseRPMTools.cmake | 176 ++++ |
| 189 | config.h.cmake | 25 +- |
| 190 | configure.ac | 226 ----- |
| 191 | cross-arm-linux-gnueabihf.cmake | 28 + |
| 192 | lib/Makefile.am | 89 -- |
| 193 | lib/base64-decode.c | 98 +- |
| 194 | lib/client-handshake.c | 123 ++- |
| 195 | lib/client-parser.c | 19 +- |
| 196 | lib/client.c | 145 ++- |
| 197 | lib/daemonize.c | 4 +- |
| 198 | lib/extension.c | 2 +- |
| 199 | lib/getifaddrs.h | 4 +- |
| 200 | lib/handshake.c | 76 +- |
| 201 | lib/libwebsockets.c | 491 ++++++---- |
| 202 | lib/libwebsockets.h | 164 ++-- |
| 203 | lib/output.c | 214 ++++- |
| 204 | lib/parsers.c | 102 +-- |
| 205 | lib/private-libwebsockets.h | 66 +- |
| 206 | lib/server-handshake.c | 5 +- |
| 207 | lib/server.c | 29 +- |
| 208 | lib/sha-1.c | 2 +- |
| 209 | libwebsockets-api-doc.html | 249 +++--- |
| 210 | libwebsockets.pc.in | 11 - |
| 211 | libwebsockets.spec | 14 +- |
| 212 | m4/ignore-me | 2 - |
| 213 | scripts/FindLibWebSockets.cmake | 33 + |
| 214 | scripts/kernel-doc | 1 + |
| 215 | test-server/Makefile.am | 131 --- |
| 216 | test-server/leaf.jpg | Bin 0 -> 2477518 bytes |
| 217 | test-server/test-client.c | 78 +- |
| 218 | test-server/test-echo.c | 33 +- |
| 219 | test-server/test-fraggle.c | 26 +- |
| 220 | test-server/test-ping.c | 15 +- |
| 221 | test-server/test-server.c | 197 +++- |
| 222 | test-server/test.html | 5 +- |
| 223 | win32port/win32helpers/gettimeofday.c | 74 +- |
| 224 | win32port/win32helpers/websock-w32.h | 6 +- |
| 225 | 48 files changed, 2493 insertions(+), 4212 deletions(-) |
| 226 | |
Andy Green | 54cb346 | 2013-02-14 22:23:54 +0800 | [diff] [blame] | 227 | |
| 228 | User api additions |
| 229 | ------------------ |
| 230 | |
| 231 | - You can now call libwebsocket_callback_on_writable() on http connectons, |
| 232 | and get a LWS_CALLBACK_HTTP_WRITEABLE callback, the same way you can |
| 233 | regulate writes with a websocket protocol connection. |
| 234 | |
Andy Green | 2672fb2 | 2013-02-22 09:54:35 +0800 | [diff] [blame] | 235 | - A new member in the context creation parameter struct "ssl_cipher_list" is |
| 236 | added, replacing CIPHERS_LIST_STRING. NULL means use the ssl library |
| 237 | default list of ciphers. |
| 238 | |
Andy Green | 58f214e | 2013-03-09 13:03:53 +0800 | [diff] [blame] | 239 | - Not really an api addition, but libwebsocket_service_fd() will now zero |
| 240 | the revents field of the pollfd it was called with if it handled the |
| 241 | descriptor. So you can tell if it is a non-lws fd by checking revents |
| 242 | after the service call... if it's still nonzero, the descriptor |
| 243 | belongs to you and you need to take care of it. |
| 244 | |
Andy Green | b55451c | 2013-03-16 12:32:27 +0800 | [diff] [blame] | 245 | - libwebsocket_rx_flow_allow_all_protocol(protocol) will unthrottle all |
| 246 | connections with the established protocol. It's designed to be |
| 247 | called from user server code when it sees it can accept more input |
| 248 | and may have throttled connections using the server rx flow apis |
| 249 | while it was unable to accept any other input The user server code |
| 250 | then does not have to try to track while connections it choked, this |
| 251 | will free up all of them in one call. |
| 252 | |
Andy Green | 0c9563b | 2013-06-10 22:54:40 +0800 | [diff] [blame] | 253 | - there's a new, optional callback LWS_CALLBACK_CLOSED_HTTP which gets |
| 254 | called when an HTTP protocol socket closes |
| 255 | |
Andy Green | 96d48fd | 2013-09-18 08:32:55 +0800 | [diff] [blame] | 256 | - for LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION callback, the user_space alloc |
| 257 | has already been done before the callback happens. That means we can |
| 258 | use the user parameter to the callback to contain the user pointer, and |
| 259 | move the protocol name to the "in" parameter. The docs for this |
| 260 | callback are also updated to reflect how to check headers in there. |
| 261 | |
Andy Green | 5dc62ea | 2013-09-20 20:26:12 +0800 | [diff] [blame] | 262 | - libwebsocket_client_connect() is now properly nonblocking and async. See |
| 263 | README.coding and test-client.c for information on the callbacks you |
| 264 | can rely on controlling the async connection period with. |
| 265 | |
Andy Green | 81877e6 | 2013-10-26 20:36:08 +0800 | [diff] [blame] | 266 | - if your OS does not support the http_proxy environment variable convention |
| 267 | (eg, reportedly OSX), you can use a new api libwebsocket_set_proxy() |
| 268 | to set the proxy details inbetween context creation and the connection |
| 269 | action. For OSes that support http_proxy, that's used automatically. |
Andy Green | b55451c | 2013-03-16 12:32:27 +0800 | [diff] [blame] | 270 | |
Andy Green | 50097dd | 2013-02-15 22:36:30 +0800 | [diff] [blame] | 271 | User api changes |
| 272 | ---------------- |
| 273 | |
| 274 | - the external poll callbacks now get the socket descriptor coming from the |
| 275 | "in" parameter. The user parameter provides the user_space for the |
| 276 | wsi as it normally does on the other callbacks. |
Edwin van den Oetelaar | 8c8a8e1 | 2013-02-20 20:56:59 +0800 | [diff] [blame] | 277 | LWS_CALLBACK_FILTER_NETWORK_CONNECTION also has the socket descriptor |
| 278 | delivered by @in now instead of @user. |
Andy Green | 50097dd | 2013-02-15 22:36:30 +0800 | [diff] [blame] | 279 | |
Andy Green | fc7c5e4 | 2013-02-23 10:50:10 +0800 | [diff] [blame] | 280 | - libwebsocket_write() now returns -1 for error, or the amount of data |
| 281 | actually accepted for send. Under load, the OS may signal it is |
| 282 | ready to send new data on the socket, but have only a restricted |
| 283 | amount of memory to buffer the packet compared to usual. |
| 284 | |
Andy Green | 50097dd | 2013-02-15 22:36:30 +0800 | [diff] [blame] | 285 | |
Andy Green | dc914cf | 2013-02-18 16:54:26 +0800 | [diff] [blame] | 286 | User api removal |
| 287 | ---------------- |
| 288 | |
| 289 | - libwebsocket_ensure_user_space() is removed from the public api, if you |
| 290 | were using it to get user_space, you need to adapt your code to only |
| 291 | use user_space inside the user callback. |
| 292 | |
Andy Green | 2672fb2 | 2013-02-22 09:54:35 +0800 | [diff] [blame] | 293 | - CIPHERS_LIST_STRING is removed |
| 294 | |
Andy Green | 0097a99 | 2013-03-09 13:06:37 +0800 | [diff] [blame] | 295 | - autotools build has been removed. See README.build for info on how to |
| 296 | use CMake for your platform |
| 297 | |
Andy Green | 54cb346 | 2013-02-14 22:23:54 +0800 | [diff] [blame] | 298 | |
Andy Green | 53a4678 | 2013-02-14 11:23:49 +0800 | [diff] [blame] | 299 | v1.21-chrome26-firefox18 |
| 300 | ======================== |
| 301 | |
| 302 | - Fixes buffer overflow bug in max frame size handling if you used the |
| 303 | default protocol buffer size. If you declared rx_buffer_size in your |
| 304 | protocol, which is recommended anyway, your code was unaffected. |
| 305 | |
Andy Green | 182cb9a | 2013-02-13 11:54:08 +0800 | [diff] [blame] | 306 | v1.2-chrome26-firefox18 |
| 307 | ======================= |
| 308 | |
| 309 | Diffstat |
| 310 | -------- |
| 311 | |
| 312 | .gitignore | 16 +++ |
| 313 | CMakeLists.txt | 544 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 314 | LICENSE | 526 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 315 | Makefile.am | 1 + |
| 316 | README | 20 +++ |
| 317 | README.build | 258 ++++++++++++++++++++++++++++++++----- |
| 318 | README.coding | 52 ++++++++ |
| 319 | changelog | 136 ++++++++++++++++++++ |
| 320 | cmake/FindOpenSSLbins.cmake | 33 +++++ |
| 321 | config.h.cmake | 173 +++++++++++++++++++++++++ |
| 322 | configure.ac | 22 +++- |
| 323 | lib/Makefile.am | 20 ++- |
| 324 | lib/base64-decode.c | 2 +- |
| 325 | lib/client-handshake.c | 190 +++++++++++----------------- |
| 326 | lib/client-parser.c | 88 +++++++------ |
| 327 | lib/client.c | 384 ++++++++++++++++++++++++++++++------------------------- |
| 328 | lib/daemonize.c | 32 +++-- |
| 329 | lib/extension-deflate-frame.c | 58 +++++---- |
| 330 | lib/extension-deflate-stream.c | 19 ++- |
| 331 | lib/extension-deflate-stream.h | 4 +- |
| 332 | lib/extension.c | 11 +- |
| 333 | lib/getifaddrs.c | 315 +++++++++++++++++++++++----------------------- |
| 334 | lib/getifaddrs.h | 30 ++--- |
| 335 | lib/handshake.c | 124 +++++++++++------- |
| 336 | lib/libwebsockets.c | 736 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------- |
| 337 | lib/libwebsockets.h | 237 ++++++++++++++++++++++------------ |
| 338 | lib/output.c | 192 +++++++++++----------------- |
| 339 | lib/parsers.c | 966 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------- |
| 340 | lib/private-libwebsockets.h | 225 +++++++++++++++++++++------------ |
| 341 | lib/server-handshake.c | 82 ++++++------ |
| 342 | lib/server.c | 96 +++++++------- |
| 343 | libwebsockets-api-doc.html | 189 ++++++++++++++++++---------- |
| 344 | libwebsockets.spec | 17 +-- |
| 345 | test-server/attack.sh | 148 ++++++++++++++++++++++ |
| 346 | test-server/test-client.c | 125 +++++++++--------- |
| 347 | test-server/test-echo.c | 31 +++-- |
| 348 | test-server/test-fraggle.c | 32 ++--- |
| 349 | test-server/test-ping.c | 52 ++++---- |
| 350 | test-server/test-server.c | 129 ++++++++++++------- |
| 351 | win32port/libwebsocketswin32/libwebsocketswin32.vcxproj | 279 ---------------------------------------- |
| 352 | win32port/libwebsocketswin32/libwebsocketswin32.vcxproj.filters | 23 +++- |
| 353 | 41 files changed, 4398 insertions(+), 2219 deletions(-) |
| 354 | |
Andy Green | 7b40545 | 2013-02-01 10:50:15 +0800 | [diff] [blame] | 355 | |
| 356 | User api additions |
| 357 | ------------------ |
| 358 | |
| 359 | - lws_get_library_version() returns a const char * with a string like |
| 360 | "1.1 9e7f737", representing the library version from configure.ac |
| 361 | and the git HEAD hash the library was built from |
| 362 | |
Andy Green | a47865f | 2013-02-10 09:39:47 +0800 | [diff] [blame] | 363 | - TCP Keepalive can now optionally be applied to all lws sockets, on Linux |
| 364 | also with controllable timeout, number of probes and probe interval. |
| 365 | (On BSD type OS, you can only use system default settings for the |
| 366 | timing and retries, although enabling it is supported by setting |
| 367 | ka_time to nonzero, the exact value has no meaning.) |
| 368 | This enables detection of idle connections which are logically okay, |
| 369 | but are in fact dead, due to network connectivity issues at the server, |
Andy Green | a690cd0 | 2013-02-09 12:25:31 +0800 | [diff] [blame] | 370 | client, or any intermediary. By default it's not enabled, but you |
| 371 | can enable it by setting a non-zero timeout (in seconds) at the new |
| 372 | ka_time member at context creation time. |
| 373 | |
Andy Green | a7109e6 | 2013-02-11 12:05:54 +0800 | [diff] [blame] | 374 | - Two new optional user callbacks added, LWS_CALLBACK_PROTOCOL_DESTROY which |
| 375 | is called one-time per protocol as the context is being destroyed, and |
| 376 | LWS_CALLBACK_PROTOCOL_INIT which is called when the context is created |
| 377 | and the protocols are added, again it's a one-time affair. |
| 378 | This lets you manage per-protocol allocations properly including |
| 379 | cleaning up after yourself when the server goes down. |
Andy Green | 7b40545 | 2013-02-01 10:50:15 +0800 | [diff] [blame] | 380 | |
Andy Green | ed33446 | 2013-02-07 21:14:33 +0800 | [diff] [blame] | 381 | User api changes |
| 382 | ---------------- |
| 383 | |
Andy Green | 1b26527 | 2013-02-09 14:01:09 +0800 | [diff] [blame] | 384 | - libwebsocket_create_context() has changed from taking a ton of parameters |
| 385 | to just taking a pointer to a struct containing the parameters. The |
| 386 | struct lws_context_creation_info is in libwebsockets.h, the members |
| 387 | are in the same order as when they were parameters to the call |
| 388 | previously. The test apps are all updated accordingly so you can |
| 389 | see example code there. |
| 390 | |
Andy Green | ed33446 | 2013-02-07 21:14:33 +0800 | [diff] [blame] | 391 | - Header tokens are now deleted after the websocket connection is |
Andy Green | 5449511 | 2013-02-06 21:10:16 +0900 | [diff] [blame] | 392 | established. Not just the header data is saved, but the pointer and |
| 393 | length array is also removed from (union) scope saving several hundred |
| 394 | bytes per connection once it is established |
| 395 | |
| 396 | - struct libwebsocket_protocols has a new member rx_buffer_size, this |
| 397 | controls rx buffer size per connection of that protocol now. Sources |
| 398 | for apps built against older versions of the library won't declare |
| 399 | this in their protocols, defaulting it to 0. Zero buffer is legal, |
| 400 | it causes a default buffer to be allocated (currently 4096) |
| 401 | |
| 402 | If you want to receive only atomic frames in your user callback, you |
| 403 | should set this to greater than your largest frame size. If a frame |
| 404 | comes that exceeds that, no error occurs but the callback happens as |
| 405 | soon as the buffer limit is reached, and again if it is reached again |
| 406 | or the frame completes. You can detect that has happened by seeing |
| 407 | there is still frame content pending using |
| 408 | libwebsockets_remaining_packet_payload() |
| 409 | |
| 410 | By correctly setting this, you can save a lot of memory when your |
| 411 | protocol has small frames (see the test server and client sources). |
| 412 | |
Andy Green | 16ab318 | 2013-02-10 18:02:31 +0800 | [diff] [blame] | 413 | - LWS_MAX_HEADER_LEN now defaults to 1024 and is the total amount of known |
| 414 | header payload lws can cope with, that includes the GET URL, origin |
| 415 | etc. Headers not understood by lws are ignored and their payload |
| 416 | not included in this. |
| 417 | |
Andy Green | 5449511 | 2013-02-06 21:10:16 +0900 | [diff] [blame] | 418 | |
| 419 | User api removals |
| 420 | ----------------- |
| 421 | |
Andy Green | 16ab318 | 2013-02-10 18:02:31 +0800 | [diff] [blame] | 422 | - The configuration-time option MAX_USER_RX_BUFFER has been replaced by a |
| 423 | buffer size chosen per-protocol. For compatibility, there's a default |
| 424 | of 4096 rx buffer, but user code should set the appropriate size for |
| 425 | the protocol frames. |
| 426 | |
| 427 | - LWS_INITIAL_HDR_ALLOC and LWS_ADDITIONAL_HDR_ALLOC are no longer needed |
| 428 | and have been removed. There's a new header management scheme that |
| 429 | handles them in a much more compact way. |
Andy Green | ed33446 | 2013-02-07 21:14:33 +0800 | [diff] [blame] | 430 | |
Andy Green | 70edd6f | 2013-02-12 10:15:25 +0800 | [diff] [blame] | 431 | - libwebsockets_hangup_on_client() is removed. If you want to close the |
| 432 | connection you must do so from the user callback and by returning |
| 433 | -1 from there. |
| 434 | |
Andy Green | 508946c | 2013-02-12 10:19:08 +0800 | [diff] [blame] | 435 | - libwebsocket_close_and_free_session() is now private to the library code |
| 436 | only and not exposed for user code. If you want to close the |
| 437 | connection, you must do so from the user callback by returning -1 |
| 438 | from there. |
| 439 | |
Andy Green | ed33446 | 2013-02-07 21:14:33 +0800 | [diff] [blame] | 440 | |
Andy Green | df60b0c | 2013-02-06 19:57:12 +0900 | [diff] [blame] | 441 | New features |
| 442 | ------------ |
| 443 | |
Andy Green | 9b09dc0 | 2013-02-08 12:48:36 +0800 | [diff] [blame] | 444 | - Cmake project file added, aimed initially at Windows support: this replaces |
Andy Green | 16ab318 | 2013-02-10 18:02:31 +0800 | [diff] [blame] | 445 | the visual studio project files that were in the tree until now. |
Andy Green | df60b0c | 2013-02-06 19:57:12 +0900 | [diff] [blame] | 446 | |
Andy Green | c3ef0d6 | 2013-02-12 10:50:49 +0800 | [diff] [blame] | 447 | - CyaSSL now supported in place of OpenSSL (--use-cyassl on configure) |
| 448 | |
Andy Green | 9b09dc0 | 2013-02-08 12:48:36 +0800 | [diff] [blame] | 449 | - PATH_MAX or MAX_PATH no longer needed |
Andy Green | df60b0c | 2013-02-06 19:57:12 +0900 | [diff] [blame] | 450 | |
Andy Green | 5449511 | 2013-02-06 21:10:16 +0900 | [diff] [blame] | 451 | - cutomizable frame rx buffer size by protocol |
| 452 | |
Andy Green | c3ef0d6 | 2013-02-12 10:50:49 +0800 | [diff] [blame] | 453 | - optional TCP keepalive so dead peers can be detected, can be enabled at |
| 454 | context-creation time |
| 455 | |
| 456 | - valgrind-clean: no SSL or CyaSSL: completely clean. With OpenSSL, 88 bytes |
| 457 | lost at OpenSSL library init and symptomless reports of uninitialized |
| 458 | memory usage... seems to be a known and ignored problem at OpenSSL |
| 459 | |
Andy Green | a3957ef | 2013-02-11 09:31:43 +0800 | [diff] [blame] | 460 | - By default debug is enabled and the library is built for -O0 -g to faclitate |
| 461 | that. Use --disable-debug configure option to build instead with -O4 |
| 462 | and no -g (debug info), obviously providing best performance and |
| 463 | reduced binary size. |
Andy Green | 7b40545 | 2013-02-01 10:50:15 +0800 | [diff] [blame] | 464 | |
Andy Green | 895d56d | 2013-02-11 09:32:53 +0800 | [diff] [blame] | 465 | - 1.0 introduced some code to try to not deflate small frames, however this |
| 466 | seems to break when confronted with a mixture of frames above and |
| 467 | below the threshold, so it's removed. Veto the compression extension |
| 468 | in your user callback if you will typically have very small frames. |
| 469 | |
Andy Green | 16ab318 | 2013-02-10 18:02:31 +0800 | [diff] [blame] | 470 | - There are many memory usage improvements, both a reduction in malloc/ |
| 471 | realloc and architectural changes. A websocket connection now |
| 472 | consumes only 296 bytes with SSL or 272 bytes without on x86_64, |
| 473 | during header processing an additional 1262 bytes is allocated in a |
| 474 | single malloc, but is freed when the websocket connection starts. |
| 475 | The RX frame buffer defined by the protocol in user |
| 476 | code is also allocated per connection, this represents the largest |
| 477 | frame you can receive atomically in that protocol. |
| 478 | |
Andy Green | c3ef0d6 | 2013-02-12 10:50:49 +0800 | [diff] [blame] | 479 | - On ARM9 build, just http+ws server no extensions or ssl, <12Kbytes .text |
| 480 | and 112 bytes per connection (+1328 only during header processing) |
| 481 | |
Andy Green | 895d56d | 2013-02-11 09:32:53 +0800 | [diff] [blame] | 482 | |
Andy Green | bd1132f | 2013-01-31 19:53:05 +0800 | [diff] [blame] | 483 | v1.1-chrome26-firefox18 |
Andy Green | a35c86f | 2013-01-31 10:16:44 +0800 | [diff] [blame] | 484 | ======================= |
| 485 | |
| 486 | Diffstat |
| 487 | -------- |
| 488 | |
| 489 | Makefile.am | 4 + |
| 490 | README-test-server | 291 --- |
| 491 | README.build | 239 ++ |
| 492 | README.coding | 138 ++ |
| 493 | README.rst | 72 - |
| 494 | README.test-apps | 272 +++ |
| 495 | configure.ac | 116 +- |
| 496 | lib/Makefile.am | 55 +- |
| 497 | lib/base64-decode.c | 5 +- |
| 498 | lib/client-handshake.c | 121 +- |
| 499 | lib/client-parser.c | 394 ++++ |
| 500 | lib/client.c | 807 +++++++ |
| 501 | lib/daemonize.c | 212 ++ |
| 502 | lib/extension-deflate-frame.c | 132 +- |
| 503 | lib/extension-deflate-stream.c | 12 +- |
| 504 | lib/extension-x-google-mux.c | 1223 ---------- |
| 505 | lib/extension-x-google-mux.h | 96 - |
| 506 | lib/extension.c | 8 - |
| 507 | lib/getifaddrs.c | 271 +++ |
| 508 | lib/getifaddrs.h | 76 + |
| 509 | lib/handshake.c | 582 +---- |
| 510 | lib/libwebsockets.c | 2493 ++++++--------------- |
| 511 | lib/libwebsockets.h | 115 +- |
| 512 | lib/md5.c | 217 -- |
| 513 | lib/minilex.c | 440 ++++ |
| 514 | lib/output.c | 628 ++++++ |
| 515 | lib/parsers.c | 2016 +++++------------ |
| 516 | lib/private-libwebsockets.h | 284 +-- |
| 517 | lib/server-handshake.c | 275 +++ |
| 518 | lib/server.c | 377 ++++ |
| 519 | libwebsockets-api-doc.html | 300 +-- |
| 520 | m4/ignore-me | 2 + |
| 521 | test-server/Makefile.am | 111 +- |
| 522 | test-server/libwebsockets.org-logo.png | Bin 0 -> 7029 bytes |
| 523 | test-server/test-client.c | 45 +- |
| 524 | test-server/test-echo.c | 330 +++ |
| 525 | test-server/test-fraggle.c | 20 +- |
| 526 | test-server/test-ping.c | 22 +- |
| 527 | test-server/test-server-extpoll.c | 554 ----- |
| 528 | test-server/test-server.c | 349 ++- |
| 529 | test-server/test.html | 3 +- |
| 530 | win32port/zlib/ZLib.vcxproj | 749 ++++--- |
| 531 | win32port/zlib/ZLib.vcxproj.filters | 188 +- |
| 532 | win32port/zlib/adler32.c | 348 ++- |
| 533 | win32port/zlib/compress.c | 160 +- |
| 534 | win32port/zlib/crc32.c | 867 ++++---- |
| 535 | win32port/zlib/crc32.h | 882 ++++---- |
| 536 | win32port/zlib/deflate.c | 3799 +++++++++++++++----------------- |
| 537 | win32port/zlib/deflate.h | 688 +++--- |
| 538 | win32port/zlib/gzclose.c | 50 +- |
| 539 | win32port/zlib/gzguts.h | 325 ++- |
| 540 | win32port/zlib/gzlib.c | 1157 +++++----- |
| 541 | win32port/zlib/gzread.c | 1242 ++++++----- |
| 542 | win32port/zlib/gzwrite.c | 1096 +++++---- |
| 543 | win32port/zlib/infback.c | 1272 ++++++----- |
| 544 | win32port/zlib/inffast.c | 680 +++--- |
| 545 | win32port/zlib/inffast.h | 22 +- |
| 546 | win32port/zlib/inffixed.h | 188 +- |
| 547 | win32port/zlib/inflate.c | 2976 +++++++++++++------------ |
| 548 | win32port/zlib/inflate.h | 244 +- |
| 549 | win32port/zlib/inftrees.c | 636 +++--- |
| 550 | win32port/zlib/inftrees.h | 124 +- |
| 551 | win32port/zlib/trees.c | 2468 +++++++++++---------- |
| 552 | win32port/zlib/trees.h | 256 +-- |
| 553 | win32port/zlib/uncompr.c | 118 +- |
| 554 | win32port/zlib/zconf.h | 934 ++++---- |
| 555 | win32port/zlib/zlib.h | 3357 ++++++++++++++-------------- |
| 556 | win32port/zlib/zutil.c | 642 +++--- |
| 557 | win32port/zlib/zutil.h | 526 ++--- |
| 558 | 69 files changed, 19556 insertions(+), 20145 deletions(-) |
| 559 | |
| 560 | user api changes |
| 561 | ---------------- |
| 562 | |
| 563 | - libwebsockets_serve_http_file() now takes a context as first argument |
| 564 | |
| 565 | - libwebsockets_get_peer_addresses() now takes a context and wsi as first |
| 566 | two arguments |
| 567 | |
| 568 | |
| 569 | user api additions |
| 570 | ------------------ |
| 571 | |
| 572 | - lwsl_...() logging apis, default to stderr but retargetable by user code; |
| 573 | may be used also by user code |
| 574 | |
| 575 | - lws_set_log_level() set which logging apis are able to emit (defaults to |
| 576 | notice, warn, err severities), optionally set the emit callback |
| 577 | |
| 578 | - lwsl_emit_syslog() helper callback emits to syslog |
| 579 | |
| 580 | - lws_daemonize() helper code that forks the app into a headless daemon |
| 581 | properly, maintains a lock file with pid in suitable for sysvinit etc to |
| 582 | control lifecycle |
| 583 | |
| 584 | - LWS_CALLBACK_HTTP_FILE_COMPLETION callback added since http file |
| 585 | transfer is now asynchronous (see test server code) |
| 586 | |
| 587 | - lws_frame_is_binary() from a wsi pointer, let you know if the received |
| 588 | data was sent in BINARY mode |
| 589 | |
| 590 | |
| 591 | user api removals |
| 592 | ----------------- |
| 593 | |
| 594 | - libwebsockets_fork_service_loop() - no longer supported (had intractable problems) |
| 595 | arrange your code to act from the user callback instead from same |
| 596 | process context as the service loop |
| 597 | |
| 598 | - libwebsockets_broadcast() - use libwebsocket_callback_on_writable[_all_protocol]() |
| 599 | instead from same process context as the service loop. See the test apps |
| 600 | for examples. |
| 601 | |
| 602 | - x-google-mux() removed until someone wants it |
| 603 | |
| 604 | - pre -v13 (ancient) protocol support removed |
| 605 | |
| 606 | |
| 607 | New features |
| 608 | ------------ |
| 609 | |
| 610 | - echo test server and client compatible with echo.websocket.org added |
| 611 | |
| 612 | - many new configure options (see README.build) to reduce footprint of the |
| 613 | library to what you actually need, eg, --without-client and |
| 614 | --without-server |
| 615 | |
| 616 | - http + websocket server can build to as little as 12K .text for ARM |
| 617 | |
| 618 | - no more MAX_CLIENTS limitation; adapts to support the max number of fds |
| 619 | allowed to the process by ulimit, defaults to 1024 on Fedora and |
| 620 | Ubuntu. Use ulimit to control this without needing to configure |
| 621 | the library. Code here is smaller and faster. |
| 622 | |
| 623 | - adaptive ratio of listen socket to connection socket service allows |
| 624 | good behaviour under Apache ab test load. Tested with thousands |
| 625 | of simultaneous connections |
| 626 | |
| 627 | - reduction in per-connection memory footprint by moving to a union to hold |
| 628 | mutually-exclusive state for the connection |
| 629 | |
| 630 | - robustness: Out of Memory taken care of for all allocation code now |
| 631 | |
| 632 | - internal getifaddrs option if your toolchain lacks it (some uclibc) |
| 633 | |
| 634 | - configurable memory limit for deflate operations |
| 635 | |
| 636 | - improvements in SSL code nonblocking operation, possible hang solved, |
| 637 | some SSL operations broken down into pollable states so there is |
| 638 | no library blocking, timeout coverage for SSL_connect |
| 639 | |
| 640 | - extpoll test server merged into single test server source |
| 641 | |
| 642 | - robustness: library should deal with all recoverable socket conditions |
| 643 | |
| 644 | - rx flowcontrol for backpressure notification fixed and implmeneted |
| 645 | correctly in the test server |
| 646 | |
| 647 | - optimal lexical parser added for header processing; all headers in a |
| 648 | single 276-byte state table |
| 649 | |
| 650 | - latency tracking api added (configure --with-latency) |
| 651 | |
| 652 | - Improved in-tree documentation, REAME.build, README.coding, |
| 653 | README.test-apps, changelog |
| 654 | |
| 655 | - Many small fixes |
| 656 | |
| 657 | |
| 658 | v1.0-chrome25-firefox17 (6cd1ea9b005933f) |