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