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