blob: 62f1ca50ed569cc7d4b89520a0ddd1c3a66d07d2 [file] [log] [blame]
Andy Greena35c86f2013-01-31 10:16:44 +08001Changelog
2---------
3
Andy Greenab620ff2015-10-28 08:39:09 +08004v1.5-chrome47-firefox41
5=======================
MGadkari020c53c2015-08-21 16:15:36 +05306
7User api changes
8----------------
9
10LWS_CALLBACK_CLIENT_CONNECTION_ERROR may provide an error string if in is
11non-NULL. If so, the string has length len.
12
Andy Green6d59f592015-10-15 09:12:58 +080013LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED is available to relax the requirement
14for peer certs if you are using the option to require client certs.
15
Andy Green4c79ee72015-10-15 11:20:40 +080016LWS_WITHOUT_BUILTIN_SHA1 cmake option forces lws to use SHA1() defined
17externally, eg, byOpenSSL, and disables build of libwebsockets_SHA1()
18
19
Andy Green16fb0132015-03-28 11:35:40 +080020v1.4-chrome43-firefox36
21=======================
Olehfaeac3c2014-07-29 23:18:41 +080022
23User api additions
24------------------
25
26There's a new member in the info struct used to control context creation,
27ssl_private_key_password, which allows passing into lws the passphrase on
28an SSL cetificate
29
Andy Greeneabed8d2014-08-11 12:11:36 +080030There's a new member in struct protocols, id, which is ignored by lws but can
31be used by the user code to mark the selected protocol by user-defined version
32or capabliity flag information, for the case multiple versions of a protocol are
33supported.
34
Andy Greenb128ccc2014-08-16 09:54:27 +080035int lws_is_ssl(wsi) added to allow user code to know if the connection was made
36over ssl or not. If LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT is used, both
37ssl and non-ssl connections are possible and may need to be treated differently
38in the user code.
39
Andy Green14425ea2014-08-18 22:49:39 +080040int lws_partial_buffered(wsi) added... should be checked after any
41libwebsocket_write that will be followed by another libwebsocket_write inside
42the same writeable callback. If set, you can't do any more writes until the
43writeable callback is called again. If you only do one write per writeable callback,
44you can ignore this.
45
Andy Green917f43a2014-10-12 14:31:47 +080046HTTP2-related: HTTP2 changes how headers are handled, lws now has new version-
47agnositic header creation APIs. These do the right thing depending on each
48connection's HTTP version without the user code having to know or care, except
49to make sure to use the new APIs for headers (test-server is updated to use
50them already, so look there for examples)
51
52The APIs "render" the headers into a user-provided buffer and bump *p as it
53is used. If *p reaches end, then the APIs return nonzero for error.
54
55LWS_VISIBLE LWS_EXTERN int
56lws_add_http_header_status(struct libwebsocket_context *context,
57 struct libwebsocket *wsi,
58 unsigned int code,
59 unsigned char **p,
60 unsigned char *end);
61
62Start a response header reporting status like 200, 500, etc
63
64LWS_VISIBLE LWS_EXTERN int
65lws_add_http_header_by_name(struct libwebsocket_context *context,
66 struct libwebsocket *wsi,
67 const unsigned char *name,
68 const unsigned char *value,
69 int length,
70 unsigned char **p,
71 unsigned char *end);
72
73Add a header like name: value in HTTP1.x
74
75LWS_VISIBLE LWS_EXTERN int
76lws_finalize_http_header(struct libwebsocket_context *context,
77 struct libwebsocket *wsi,
78 unsigned char **p,
79 unsigned char *end);
80
81Finish off the headers, like add the extra \r\n in HTTP1.x
82
83LWS_VISIBLE LWS_EXTERN int
84lws_add_http_header_by_token(struct libwebsocket_context *context,
85 struct libwebsocket *wsi,
86 enum lws_token_indexes token,
87 const unsigned char *value,
88 int length,
89 unsigned char **p,
90 unsigned char *end);
91
92Add a header by using a lws token as the name part. In HTTP2, this can be
93compressed to one or two bytes.
94
Olehfaeac3c2014-07-29 23:18:41 +080095
Andy Green822241c2014-08-18 22:21:51 +080096User api removal
97----------------
98
99protocols struct member no_buffer_all_partial_tx is removed. Under some
100conditions like rewriting extention such as compression in use, the built-in
101partial send buffering is the only way to deal with the problem, so turning
102it off is deprecated.
103
104
Andy Green917f43a2014-10-12 14:31:47 +0800105User api changes
106----------------
107
108HTTP2-related: API libwebsockets_serve_http_file() takes an extra parameter at
109the end now
110
111int other_headers_len)
112
113If you are providing other headers, they must be generated using the new
114HTTP-version-agnostic APIs, and you must provide the length of them using this
115additional parameter.
116
joseph.urciuoli4d9c8fc2014-10-16 08:53:19 +0800117struct lws_context_creation_info now has an additional member
118SSL_CTX *provided_client_ssl_ctx you may set to an externally-initialized
119SSL_CTX managed outside lws. Defaulting to zero keeps the existing behaviour of
120lws managing the context, if you memset the struct to 0 or have as a filescope
121initialized struct in bss, no need to change anything.
122
Andy Green822241c2014-08-18 22:21:51 +0800123
Andy Greenc1fdd102014-07-06 09:56:11 +0800124v1.3-chrome37-firefox30
125=======================
126
127 .gitignore | 1 -
128 CMakeLists.txt | 447 +++--
129 README.build | 35 +-
130 README.coding | 14 +
131 changelog | 66 +
132 cmake/LibwebsocketsConfig.cmake.in | 17 +
133 cmake/LibwebsocketsConfigVersion.cmake.in | 11 +
134 config.h.cmake | 18 +
135 cross-ming.cmake | 31 +
136 cross-openwrt-makefile | 91 +
137 lib/client-handshake.c | 205 ++-
138 lib/client-parser.c | 58 +-
139 lib/client.c | 158 +-
140 lib/context.c | 341 ++++
141 lib/extension-deflate-frame.c | 2 +-
142 lib/extension.c | 178 ++
143 lib/handshake.c | 287 +---
144 lib/lextable.h | 338 ++++
145 lib/libev.c | 175 ++
146 lib/libwebsockets.c | 2089 +++--------------------
147 lib/libwebsockets.h | 253 ++-
148 lib/lws-plat-unix.c | 404 +++++
149 lib/lws-plat-win.c | 358 ++++
150 lib/minilex.c | 530 +++---
151 lib/output.c | 445 ++---
152 lib/parsers.c | 682 ++++----
153 lib/pollfd.c | 239 +++
154 lib/private-libwebsockets.h | 501 +++++-
155 lib/server-handshake.c | 274 +--
156 lib/server.c | 858 ++++++++--
157 lib/service.c | 517 ++++++
158 lib/sha-1.c | 38 +-
159 lib/ssl-http2.c | 78 +
160 lib/ssl.c | 571 +++++++
161 test-server/attack.sh | 101 +-
162 test-server/test-client.c | 9 +-
163 test-server/test-echo.c | 17 +-
164 test-server/test-fraggle.c | 7 -
165 test-server/test-ping.c | 12 +-
166 test-server/test-server.c | 330 ++--
167 test-server/test.html | 4 +-
168 win32port/client/client.vcxproj | 259 ---
169 win32port/client/client.vcxproj.filters | 39 -
170 .../libwebsocketswin32.vcxproj.filters | 93 -
171 win32port/server/server.vcxproj | 276 ---
172 win32port/server/server.vcxproj.filters | 51 -
173 win32port/win32helpers/gettimeofday.h | 59 +-
174 win32port/win32helpers/netdb.h | 1 -
175 win32port/win32helpers/strings.h | 0
176 win32port/win32helpers/sys/time.h | 1 -
177 win32port/win32helpers/unistd.h | 0
178 win32port/win32helpers/websock-w32.c | 104 --
179 win32port/win32helpers/websock-w32.h | 62 -
180 win32port/win32port.sln | 100 --
181 win32port/zlib/gzio.c | 3 +-
182 55 files changed, 6779 insertions(+), 5059 deletions(-)
183
Andy Green79002562013-11-09 11:04:35 +0800184
kapejodce64fb02013-11-19 13:38:16 +0100185User api additions
186------------------
187
188POST method is supported
189
190The protocol 0 / HTTP callback can now get two new kinds of callback,
191LWS_CALLBACK_HTTP_BODY (in and len are a chunk of the body of the HTTP request)
192and LWS_CALLBACK_HTTP_BODY_COMPLETION (the expected amount of body has arrived
193and been passed to the user code already). These callbacks are used with the
194post method (see the test server for details).
195
196The period between the HTTP header completion and the completion of the body
197processing is protected by a 5s timeout.
198
199The chunks are stored in a malloc'd buffer of size protocols[0].rx_buffer_size.
200
201
James Devine5b34c972013-12-14 11:41:29 +0800202New server option you can enable from user code
203LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT allows non-SSL connections to
204also be accepted on an SSL listening port. It's disabled unless you enable
205it explicitly.
206
207
Andy Green7a132792013-12-18 09:48:26 +0800208Two new callbacks are added in protocols[0] that are optional for allowing
209limited thread access to libwebsockets, LWS_CALLBACK_LOCK_POLL and
210LWS_CALLBACK_UNLOCK_POLL.
211
212If you use them, they protect internal and external poll list changes, but if
213you want to use external thread access to libwebsocket_callback_on_writable()
214you have to implement your locking here even if you don't use external
215poll support.
216
217If you will use another thread for this, take a lot of care about managing
218your list of live wsi by doing it from ESTABLISHED and CLOSED callbacks
219(with your own locking).
220
Andrew Canaday9769f4f2014-03-23 13:25:07 +0800221If you configure cmake with -DLWS_WITH_LIBEV=1 then the code allowing the libev
222eventloop instead of the default poll() one will also be compiled in. But to
223use it, you must also set the LWS_SERVER_OPTION_LIBEV flag on the context
224creation info struct options member.
Andy Green7a132792013-12-18 09:48:26 +0800225
Andy Greenc1fdd102014-07-06 09:56:11 +0800226IPV6 is supported and enabled by default except for Windows, you can disable
227the support at build-time by giving -DLWS_IPV6=, and disable use of it even if
James Devine3f13ea22014-03-24 16:09:25 +0800228compiled in by making sure the flag LWS_SERVER_OPTION_DISABLE_IPV6 is set on
229the context creation info struct options member.
230
Andy Greenc1fdd102014-07-06 09:56:11 +0800231You can give LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS option flag to
232guarantee the OS CAs will not be used, even if that support was selected at
233build-time.
234
235Optional "token limits" may be enforced by setting the member "token_limits"
236in struct lws_context_creation_info to point to a struct lws_token_limits.
237NULL means no token limits used for compatibility.
238
Andy Green7a132792013-12-18 09:48:26 +0800239
Andy Green79002562013-11-09 11:04:35 +0800240User api changes
241----------------
242
243Extra optional argument to libwebsockets_serve_http_file() allows injecion
244of HTTP headers into the canned response. Eg, cookies may be added like
245that without getting involved in having to send the header by hand.
246
Patrick Gansterer148b9452014-02-28 02:31:23 +0100247A new info member http_proxy_address may be used at context creation time to
248set the http proxy. If non-NULL, it overrides http_proxy environment var.
Andy Green79002562013-11-09 11:04:35 +0800249
Andy Greend2ec7ad2014-03-15 10:39:29 +0800250Cmake supports LWS_SSL_CLIENT_USE_OS_CA_CERTS defaulting to on, which gets
251the client to use the OS CA Roots. If you're worried somebody with the
252ability to forge for force creation of a client cert from the root CA in
253your OS, you should disable this since your selfsigned $0 cert is a lot safer
254then...
255
Andy Green79002562013-11-09 11:04:35 +0800256
Andy Green81877e62013-10-26 20:36:08 +0800257v1.23-chrome32-firefox24
258========================
259
260 Android.mk | 29 +
261 CMakeLists.txt | 573 ++++++++----
262 COPYING | 503 -----------
263 INSTALL | 365 --------
264 Makefile.am | 13 -
265 README.build | 371 ++------
266 README.coding | 63 ++
267 autogen.sh | 1578 ---------------------------------
268 changelog | 69 ++
269 cmake/FindGit.cmake | 163 ++++
270 cmake/FindOpenSSLbins.cmake | 15 +-
271 cmake/UseRPMTools.cmake | 176 ++++
272 config.h.cmake | 25 +-
273 configure.ac | 226 -----
274 cross-arm-linux-gnueabihf.cmake | 28 +
275 lib/Makefile.am | 89 --
276 lib/base64-decode.c | 98 +-
277 lib/client-handshake.c | 123 ++-
278 lib/client-parser.c | 19 +-
279 lib/client.c | 145 ++-
280 lib/daemonize.c | 4 +-
281 lib/extension.c | 2 +-
282 lib/getifaddrs.h | 4 +-
283 lib/handshake.c | 76 +-
284 lib/libwebsockets.c | 491 ++++++----
285 lib/libwebsockets.h | 164 ++--
286 lib/output.c | 214 ++++-
287 lib/parsers.c | 102 +--
288 lib/private-libwebsockets.h | 66 +-
289 lib/server-handshake.c | 5 +-
290 lib/server.c | 29 +-
291 lib/sha-1.c | 2 +-
292 libwebsockets-api-doc.html | 249 +++---
293 libwebsockets.pc.in | 11 -
294 libwebsockets.spec | 14 +-
295 m4/ignore-me | 2 -
296 scripts/FindLibWebSockets.cmake | 33 +
297 scripts/kernel-doc | 1 +
298 test-server/Makefile.am | 131 ---
299 test-server/leaf.jpg | Bin 0 -> 2477518 bytes
300 test-server/test-client.c | 78 +-
301 test-server/test-echo.c | 33 +-
302 test-server/test-fraggle.c | 26 +-
303 test-server/test-ping.c | 15 +-
304 test-server/test-server.c | 197 +++-
305 test-server/test.html | 5 +-
306 win32port/win32helpers/gettimeofday.c | 74 +-
307 win32port/win32helpers/websock-w32.h | 6 +-
308 48 files changed, 2493 insertions(+), 4212 deletions(-)
309
Andy Green54cb3462013-02-14 22:23:54 +0800310
311User api additions
312------------------
313
314 - You can now call libwebsocket_callback_on_writable() on http connectons,
315 and get a LWS_CALLBACK_HTTP_WRITEABLE callback, the same way you can
316 regulate writes with a websocket protocol connection.
317
Andy Green2672fb22013-02-22 09:54:35 +0800318 - A new member in the context creation parameter struct "ssl_cipher_list" is
319 added, replacing CIPHERS_LIST_STRING. NULL means use the ssl library
320 default list of ciphers.
321
Andy Green58f214e2013-03-09 13:03:53 +0800322 - Not really an api addition, but libwebsocket_service_fd() will now zero
323 the revents field of the pollfd it was called with if it handled the
324 descriptor. So you can tell if it is a non-lws fd by checking revents
325 after the service call... if it's still nonzero, the descriptor
326 belongs to you and you need to take care of it.
327
Andy Greenb55451c2013-03-16 12:32:27 +0800328 - libwebsocket_rx_flow_allow_all_protocol(protocol) will unthrottle all
329 connections with the established protocol. It's designed to be
330 called from user server code when it sees it can accept more input
331 and may have throttled connections using the server rx flow apis
332 while it was unable to accept any other input The user server code
333 then does not have to try to track while connections it choked, this
334 will free up all of them in one call.
335
Andy Green0c9563b2013-06-10 22:54:40 +0800336 - there's a new, optional callback LWS_CALLBACK_CLOSED_HTTP which gets
337 called when an HTTP protocol socket closes
338
Andy Green96d48fd2013-09-18 08:32:55 +0800339 - for LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION callback, the user_space alloc
340 has already been done before the callback happens. That means we can
341 use the user parameter to the callback to contain the user pointer, and
342 move the protocol name to the "in" parameter. The docs for this
343 callback are also updated to reflect how to check headers in there.
344
Andy Green5dc62ea2013-09-20 20:26:12 +0800345 - libwebsocket_client_connect() is now properly nonblocking and async. See
346 README.coding and test-client.c for information on the callbacks you
347 can rely on controlling the async connection period with.
348
Andy Green81877e62013-10-26 20:36:08 +0800349 - if your OS does not support the http_proxy environment variable convention
350 (eg, reportedly OSX), you can use a new api libwebsocket_set_proxy()
351 to set the proxy details inbetween context creation and the connection
352 action. For OSes that support http_proxy, that's used automatically.
Andy Greenb55451c2013-03-16 12:32:27 +0800353
Andy Green50097dd2013-02-15 22:36:30 +0800354User api changes
355----------------
356
357 - the external poll callbacks now get the socket descriptor coming from the
358 "in" parameter. The user parameter provides the user_space for the
359 wsi as it normally does on the other callbacks.
Edwin van den Oetelaar8c8a8e12013-02-20 20:56:59 +0800360 LWS_CALLBACK_FILTER_NETWORK_CONNECTION also has the socket descriptor
361 delivered by @in now instead of @user.
Andy Green50097dd2013-02-15 22:36:30 +0800362
Andy Greenfc7c5e42013-02-23 10:50:10 +0800363 - libwebsocket_write() now returns -1 for error, or the amount of data
364 actually accepted for send. Under load, the OS may signal it is
365 ready to send new data on the socket, but have only a restricted
366 amount of memory to buffer the packet compared to usual.
367
Andy Green50097dd2013-02-15 22:36:30 +0800368
Andy Greendc914cf2013-02-18 16:54:26 +0800369User api removal
370----------------
371
372 - libwebsocket_ensure_user_space() is removed from the public api, if you
373 were using it to get user_space, you need to adapt your code to only
374 use user_space inside the user callback.
375
Andy Green2672fb22013-02-22 09:54:35 +0800376 - CIPHERS_LIST_STRING is removed
377
Andy Green0097a992013-03-09 13:06:37 +0800378 - autotools build has been removed. See README.build for info on how to
379 use CMake for your platform
380
Andy Green54cb3462013-02-14 22:23:54 +0800381
Andy Green53a46782013-02-14 11:23:49 +0800382v1.21-chrome26-firefox18
383========================
384
385 - Fixes buffer overflow bug in max frame size handling if you used the
386 default protocol buffer size. If you declared rx_buffer_size in your
387 protocol, which is recommended anyway, your code was unaffected.
388
Andy Green182cb9a2013-02-13 11:54:08 +0800389v1.2-chrome26-firefox18
390=======================
391
392Diffstat
393--------
394
395 .gitignore | 16 +++
396 CMakeLists.txt | 544 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
397 LICENSE | 526 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
398 Makefile.am | 1 +
399 README | 20 +++
400 README.build | 258 ++++++++++++++++++++++++++++++++-----
401 README.coding | 52 ++++++++
402 changelog | 136 ++++++++++++++++++++
403 cmake/FindOpenSSLbins.cmake | 33 +++++
404 config.h.cmake | 173 +++++++++++++++++++++++++
405 configure.ac | 22 +++-
406 lib/Makefile.am | 20 ++-
407 lib/base64-decode.c | 2 +-
408 lib/client-handshake.c | 190 +++++++++++-----------------
409 lib/client-parser.c | 88 +++++++------
410 lib/client.c | 384 ++++++++++++++++++++++++++++++-------------------------
411 lib/daemonize.c | 32 +++--
412 lib/extension-deflate-frame.c | 58 +++++----
413 lib/extension-deflate-stream.c | 19 ++-
414 lib/extension-deflate-stream.h | 4 +-
415 lib/extension.c | 11 +-
416 lib/getifaddrs.c | 315 +++++++++++++++++++++++-----------------------
417 lib/getifaddrs.h | 30 ++---
418 lib/handshake.c | 124 +++++++++++-------
419 lib/libwebsockets.c | 736 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------
420 lib/libwebsockets.h | 237 ++++++++++++++++++++++------------
421 lib/output.c | 192 +++++++++++-----------------
422 lib/parsers.c | 966 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------
423 lib/private-libwebsockets.h | 225 +++++++++++++++++++++------------
424 lib/server-handshake.c | 82 ++++++------
425 lib/server.c | 96 +++++++-------
426 libwebsockets-api-doc.html | 189 ++++++++++++++++++----------
427 libwebsockets.spec | 17 +--
428 test-server/attack.sh | 148 ++++++++++++++++++++++
429 test-server/test-client.c | 125 +++++++++---------
430 test-server/test-echo.c | 31 +++--
431 test-server/test-fraggle.c | 32 ++---
432 test-server/test-ping.c | 52 ++++----
433 test-server/test-server.c | 129 ++++++++++++-------
434 win32port/libwebsocketswin32/libwebsocketswin32.vcxproj | 279 ----------------------------------------
435 win32port/libwebsocketswin32/libwebsocketswin32.vcxproj.filters | 23 +++-
436 41 files changed, 4398 insertions(+), 2219 deletions(-)
437
Andy Green7b405452013-02-01 10:50:15 +0800438
439User api additions
440------------------
441
442 - lws_get_library_version() returns a const char * with a string like
443 "1.1 9e7f737", representing the library version from configure.ac
444 and the git HEAD hash the library was built from
445
Andy Greena47865f2013-02-10 09:39:47 +0800446 - TCP Keepalive can now optionally be applied to all lws sockets, on Linux
447 also with controllable timeout, number of probes and probe interval.
448 (On BSD type OS, you can only use system default settings for the
449 timing and retries, although enabling it is supported by setting
450 ka_time to nonzero, the exact value has no meaning.)
451 This enables detection of idle connections which are logically okay,
452 but are in fact dead, due to network connectivity issues at the server,
Andy Greena690cd02013-02-09 12:25:31 +0800453 client, or any intermediary. By default it's not enabled, but you
454 can enable it by setting a non-zero timeout (in seconds) at the new
455 ka_time member at context creation time.
456
Andy Greena7109e62013-02-11 12:05:54 +0800457 - Two new optional user callbacks added, LWS_CALLBACK_PROTOCOL_DESTROY which
458 is called one-time per protocol as the context is being destroyed, and
459 LWS_CALLBACK_PROTOCOL_INIT which is called when the context is created
460 and the protocols are added, again it's a one-time affair.
461 This lets you manage per-protocol allocations properly including
462 cleaning up after yourself when the server goes down.
Andy Green7b405452013-02-01 10:50:15 +0800463
Andy Greened334462013-02-07 21:14:33 +0800464User api changes
465----------------
466
Andy Green1b265272013-02-09 14:01:09 +0800467 - libwebsocket_create_context() has changed from taking a ton of parameters
468 to just taking a pointer to a struct containing the parameters. The
469 struct lws_context_creation_info is in libwebsockets.h, the members
470 are in the same order as when they were parameters to the call
471 previously. The test apps are all updated accordingly so you can
472 see example code there.
473
Andy Greened334462013-02-07 21:14:33 +0800474 - Header tokens are now deleted after the websocket connection is
Andy Green54495112013-02-06 21:10:16 +0900475 established. Not just the header data is saved, but the pointer and
476 length array is also removed from (union) scope saving several hundred
477 bytes per connection once it is established
478
479 - struct libwebsocket_protocols has a new member rx_buffer_size, this
480 controls rx buffer size per connection of that protocol now. Sources
481 for apps built against older versions of the library won't declare
482 this in their protocols, defaulting it to 0. Zero buffer is legal,
483 it causes a default buffer to be allocated (currently 4096)
484
485 If you want to receive only atomic frames in your user callback, you
486 should set this to greater than your largest frame size. If a frame
487 comes that exceeds that, no error occurs but the callback happens as
488 soon as the buffer limit is reached, and again if it is reached again
489 or the frame completes. You can detect that has happened by seeing
490 there is still frame content pending using
491 libwebsockets_remaining_packet_payload()
492
493 By correctly setting this, you can save a lot of memory when your
494 protocol has small frames (see the test server and client sources).
495
Andy Green16ab3182013-02-10 18:02:31 +0800496 - LWS_MAX_HEADER_LEN now defaults to 1024 and is the total amount of known
497 header payload lws can cope with, that includes the GET URL, origin
498 etc. Headers not understood by lws are ignored and their payload
499 not included in this.
500
Andy Green54495112013-02-06 21:10:16 +0900501
502User api removals
503-----------------
504
Andy Green16ab3182013-02-10 18:02:31 +0800505 - The configuration-time option MAX_USER_RX_BUFFER has been replaced by a
506 buffer size chosen per-protocol. For compatibility, there's a default
507 of 4096 rx buffer, but user code should set the appropriate size for
508 the protocol frames.
509
510 - LWS_INITIAL_HDR_ALLOC and LWS_ADDITIONAL_HDR_ALLOC are no longer needed
511 and have been removed. There's a new header management scheme that
512 handles them in a much more compact way.
Andy Greened334462013-02-07 21:14:33 +0800513
Andy Green70edd6f2013-02-12 10:15:25 +0800514 - libwebsockets_hangup_on_client() is removed. If you want to close the
515 connection you must do so from the user callback and by returning
516 -1 from there.
517
Andy Green508946c2013-02-12 10:19:08 +0800518 - libwebsocket_close_and_free_session() is now private to the library code
519 only and not exposed for user code. If you want to close the
520 connection, you must do so from the user callback by returning -1
521 from there.
522
Andy Greened334462013-02-07 21:14:33 +0800523
Andy Greendf60b0c2013-02-06 19:57:12 +0900524New features
525------------
526
Andy Green9b09dc02013-02-08 12:48:36 +0800527 - Cmake project file added, aimed initially at Windows support: this replaces
Andy Green16ab3182013-02-10 18:02:31 +0800528 the visual studio project files that were in the tree until now.
Andy Greendf60b0c2013-02-06 19:57:12 +0900529
Andy Greenc3ef0d62013-02-12 10:50:49 +0800530 - CyaSSL now supported in place of OpenSSL (--use-cyassl on configure)
531
Andy Green9b09dc02013-02-08 12:48:36 +0800532 - PATH_MAX or MAX_PATH no longer needed
Andy Greendf60b0c2013-02-06 19:57:12 +0900533
Andy Green54495112013-02-06 21:10:16 +0900534 - cutomizable frame rx buffer size by protocol
535
Andy Greenc3ef0d62013-02-12 10:50:49 +0800536 - optional TCP keepalive so dead peers can be detected, can be enabled at
537 context-creation time
538
539 - valgrind-clean: no SSL or CyaSSL: completely clean. With OpenSSL, 88 bytes
540 lost at OpenSSL library init and symptomless reports of uninitialized
541 memory usage... seems to be a known and ignored problem at OpenSSL
542
Andy Greena3957ef2013-02-11 09:31:43 +0800543 - By default debug is enabled and the library is built for -O0 -g to faclitate
544 that. Use --disable-debug configure option to build instead with -O4
545 and no -g (debug info), obviously providing best performance and
546 reduced binary size.
Andy Green7b405452013-02-01 10:50:15 +0800547
Andy Green895d56d2013-02-11 09:32:53 +0800548 - 1.0 introduced some code to try to not deflate small frames, however this
549 seems to break when confronted with a mixture of frames above and
550 below the threshold, so it's removed. Veto the compression extension
551 in your user callback if you will typically have very small frames.
552
Andy Green16ab3182013-02-10 18:02:31 +0800553 - There are many memory usage improvements, both a reduction in malloc/
554 realloc and architectural changes. A websocket connection now
555 consumes only 296 bytes with SSL or 272 bytes without on x86_64,
556 during header processing an additional 1262 bytes is allocated in a
557 single malloc, but is freed when the websocket connection starts.
558 The RX frame buffer defined by the protocol in user
559 code is also allocated per connection, this represents the largest
560 frame you can receive atomically in that protocol.
561
Andy Greenc3ef0d62013-02-12 10:50:49 +0800562 - On ARM9 build, just http+ws server no extensions or ssl, <12Kbytes .text
563 and 112 bytes per connection (+1328 only during header processing)
564
Andy Green895d56d2013-02-11 09:32:53 +0800565
Andy Greenbd1132f2013-01-31 19:53:05 +0800566v1.1-chrome26-firefox18
Andy Greena35c86f2013-01-31 10:16:44 +0800567=======================
568
569Diffstat
570--------
571
572 Makefile.am | 4 +
573 README-test-server | 291 ---
574 README.build | 239 ++
575 README.coding | 138 ++
576 README.rst | 72 -
577 README.test-apps | 272 +++
578 configure.ac | 116 +-
579 lib/Makefile.am | 55 +-
580 lib/base64-decode.c | 5 +-
581 lib/client-handshake.c | 121 +-
582 lib/client-parser.c | 394 ++++
583 lib/client.c | 807 +++++++
584 lib/daemonize.c | 212 ++
585 lib/extension-deflate-frame.c | 132 +-
586 lib/extension-deflate-stream.c | 12 +-
587 lib/extension-x-google-mux.c | 1223 ----------
588 lib/extension-x-google-mux.h | 96 -
589 lib/extension.c | 8 -
590 lib/getifaddrs.c | 271 +++
591 lib/getifaddrs.h | 76 +
592 lib/handshake.c | 582 +----
593 lib/libwebsockets.c | 2493 ++++++---------------
594 lib/libwebsockets.h | 115 +-
595 lib/md5.c | 217 --
596 lib/minilex.c | 440 ++++
597 lib/output.c | 628 ++++++
598 lib/parsers.c | 2016 +++++------------
599 lib/private-libwebsockets.h | 284 +--
600 lib/server-handshake.c | 275 +++
601 lib/server.c | 377 ++++
602 libwebsockets-api-doc.html | 300 +--
603 m4/ignore-me | 2 +
604 test-server/Makefile.am | 111 +-
605 test-server/libwebsockets.org-logo.png | Bin 0 -> 7029 bytes
606 test-server/test-client.c | 45 +-
607 test-server/test-echo.c | 330 +++
608 test-server/test-fraggle.c | 20 +-
609 test-server/test-ping.c | 22 +-
610 test-server/test-server-extpoll.c | 554 -----
611 test-server/test-server.c | 349 ++-
612 test-server/test.html | 3 +-
613 win32port/zlib/ZLib.vcxproj | 749 ++++---
614 win32port/zlib/ZLib.vcxproj.filters | 188 +-
615 win32port/zlib/adler32.c | 348 ++-
616 win32port/zlib/compress.c | 160 +-
617 win32port/zlib/crc32.c | 867 ++++----
618 win32port/zlib/crc32.h | 882 ++++----
619 win32port/zlib/deflate.c | 3799 +++++++++++++++-----------------
620 win32port/zlib/deflate.h | 688 +++---
621 win32port/zlib/gzclose.c | 50 +-
622 win32port/zlib/gzguts.h | 325 ++-
623 win32port/zlib/gzlib.c | 1157 +++++-----
624 win32port/zlib/gzread.c | 1242 ++++++-----
625 win32port/zlib/gzwrite.c | 1096 +++++----
626 win32port/zlib/infback.c | 1272 ++++++-----
627 win32port/zlib/inffast.c | 680 +++---
628 win32port/zlib/inffast.h | 22 +-
629 win32port/zlib/inffixed.h | 188 +-
630 win32port/zlib/inflate.c | 2976 +++++++++++++------------
631 win32port/zlib/inflate.h | 244 +-
632 win32port/zlib/inftrees.c | 636 +++---
633 win32port/zlib/inftrees.h | 124 +-
634 win32port/zlib/trees.c | 2468 +++++++++++----------
635 win32port/zlib/trees.h | 256 +--
636 win32port/zlib/uncompr.c | 118 +-
637 win32port/zlib/zconf.h | 934 ++++----
638 win32port/zlib/zlib.h | 3357 ++++++++++++++--------------
639 win32port/zlib/zutil.c | 642 +++---
640 win32port/zlib/zutil.h | 526 ++---
641 69 files changed, 19556 insertions(+), 20145 deletions(-)
642
643user api changes
644----------------
645
646 - libwebsockets_serve_http_file() now takes a context as first argument
647
648 - libwebsockets_get_peer_addresses() now takes a context and wsi as first
649 two arguments
650
651
652user api additions
653------------------
654
655 - lwsl_...() logging apis, default to stderr but retargetable by user code;
656 may be used also by user code
657
658 - lws_set_log_level() set which logging apis are able to emit (defaults to
659 notice, warn, err severities), optionally set the emit callback
660
661 - lwsl_emit_syslog() helper callback emits to syslog
662
663 - lws_daemonize() helper code that forks the app into a headless daemon
664 properly, maintains a lock file with pid in suitable for sysvinit etc to
665 control lifecycle
666
667 - LWS_CALLBACK_HTTP_FILE_COMPLETION callback added since http file
668 transfer is now asynchronous (see test server code)
669
670 - lws_frame_is_binary() from a wsi pointer, let you know if the received
671 data was sent in BINARY mode
672
673
674user api removals
675-----------------
676
677 - libwebsockets_fork_service_loop() - no longer supported (had intractable problems)
678 arrange your code to act from the user callback instead from same
679 process context as the service loop
680
681 - libwebsockets_broadcast() - use libwebsocket_callback_on_writable[_all_protocol]()
682 instead from same process context as the service loop. See the test apps
683 for examples.
684
685 - x-google-mux() removed until someone wants it
686
687 - pre -v13 (ancient) protocol support removed
688
689
690New features
691------------
692
693 - echo test server and client compatible with echo.websocket.org added
694
695 - many new configure options (see README.build) to reduce footprint of the
696 library to what you actually need, eg, --without-client and
697 --without-server
698
699 - http + websocket server can build to as little as 12K .text for ARM
700
701 - no more MAX_CLIENTS limitation; adapts to support the max number of fds
702 allowed to the process by ulimit, defaults to 1024 on Fedora and
703 Ubuntu. Use ulimit to control this without needing to configure
704 the library. Code here is smaller and faster.
705
706 - adaptive ratio of listen socket to connection socket service allows
707 good behaviour under Apache ab test load. Tested with thousands
708 of simultaneous connections
709
710 - reduction in per-connection memory footprint by moving to a union to hold
711 mutually-exclusive state for the connection
712
713 - robustness: Out of Memory taken care of for all allocation code now
714
715 - internal getifaddrs option if your toolchain lacks it (some uclibc)
716
717 - configurable memory limit for deflate operations
718
719 - improvements in SSL code nonblocking operation, possible hang solved,
720 some SSL operations broken down into pollable states so there is
721 no library blocking, timeout coverage for SSL_connect
722
723 - extpoll test server merged into single test server source
724
725 - robustness: library should deal with all recoverable socket conditions
726
727 - rx flowcontrol for backpressure notification fixed and implmeneted
728 correctly in the test server
729
730 - optimal lexical parser added for header processing; all headers in a
731 single 276-byte state table
732
733 - latency tracking api added (configure --with-latency)
734
735 - Improved in-tree documentation, REAME.build, README.coding,
736 README.test-apps, changelog
737
738 - Many small fixes
739
740
741v1.0-chrome25-firefox17 (6cd1ea9b005933f)