blob: c2904ef3e5ff597bb42a046adca889b69df2a8a2 [file] [log] [blame]
Andy Greena35c86f2013-01-31 10:16:44 +08001Changelog
2---------
3
Andy Green79002562013-11-09 11:04:35 +08004(since v1.23)
5
6User api changes
7----------------
8
9Extra optional argument to libwebsockets_serve_http_file() allows injecion
10of HTTP headers into the canned response. Eg, cookies may be added like
11that without getting involved in having to send the header by hand.
12
13
14
Andy Green81877e62013-10-26 20:36:08 +080015v1.23-chrome32-firefox24
16========================
17
18 Android.mk | 29 +
19 CMakeLists.txt | 573 ++++++++----
20 COPYING | 503 -----------
21 INSTALL | 365 --------
22 Makefile.am | 13 -
23 README.build | 371 ++------
24 README.coding | 63 ++
25 autogen.sh | 1578 ---------------------------------
26 changelog | 69 ++
27 cmake/FindGit.cmake | 163 ++++
28 cmake/FindOpenSSLbins.cmake | 15 +-
29 cmake/UseRPMTools.cmake | 176 ++++
30 config.h.cmake | 25 +-
31 configure.ac | 226 -----
32 cross-arm-linux-gnueabihf.cmake | 28 +
33 lib/Makefile.am | 89 --
34 lib/base64-decode.c | 98 +-
35 lib/client-handshake.c | 123 ++-
36 lib/client-parser.c | 19 +-
37 lib/client.c | 145 ++-
38 lib/daemonize.c | 4 +-
39 lib/extension.c | 2 +-
40 lib/getifaddrs.h | 4 +-
41 lib/handshake.c | 76 +-
42 lib/libwebsockets.c | 491 ++++++----
43 lib/libwebsockets.h | 164 ++--
44 lib/output.c | 214 ++++-
45 lib/parsers.c | 102 +--
46 lib/private-libwebsockets.h | 66 +-
47 lib/server-handshake.c | 5 +-
48 lib/server.c | 29 +-
49 lib/sha-1.c | 2 +-
50 libwebsockets-api-doc.html | 249 +++---
51 libwebsockets.pc.in | 11 -
52 libwebsockets.spec | 14 +-
53 m4/ignore-me | 2 -
54 scripts/FindLibWebSockets.cmake | 33 +
55 scripts/kernel-doc | 1 +
56 test-server/Makefile.am | 131 ---
57 test-server/leaf.jpg | Bin 0 -> 2477518 bytes
58 test-server/test-client.c | 78 +-
59 test-server/test-echo.c | 33 +-
60 test-server/test-fraggle.c | 26 +-
61 test-server/test-ping.c | 15 +-
62 test-server/test-server.c | 197 +++-
63 test-server/test.html | 5 +-
64 win32port/win32helpers/gettimeofday.c | 74 +-
65 win32port/win32helpers/websock-w32.h | 6 +-
66 48 files changed, 2493 insertions(+), 4212 deletions(-)
67
Andy Green54cb3462013-02-14 22:23:54 +080068
69User api additions
70------------------
71
72 - You can now call libwebsocket_callback_on_writable() on http connectons,
73 and get a LWS_CALLBACK_HTTP_WRITEABLE callback, the same way you can
74 regulate writes with a websocket protocol connection.
75
Andy Green2672fb22013-02-22 09:54:35 +080076 - A new member in the context creation parameter struct "ssl_cipher_list" is
77 added, replacing CIPHERS_LIST_STRING. NULL means use the ssl library
78 default list of ciphers.
79
Andy Green58f214e2013-03-09 13:03:53 +080080 - Not really an api addition, but libwebsocket_service_fd() will now zero
81 the revents field of the pollfd it was called with if it handled the
82 descriptor. So you can tell if it is a non-lws fd by checking revents
83 after the service call... if it's still nonzero, the descriptor
84 belongs to you and you need to take care of it.
85
Andy Greenb55451c2013-03-16 12:32:27 +080086 - libwebsocket_rx_flow_allow_all_protocol(protocol) will unthrottle all
87 connections with the established protocol. It's designed to be
88 called from user server code when it sees it can accept more input
89 and may have throttled connections using the server rx flow apis
90 while it was unable to accept any other input The user server code
91 then does not have to try to track while connections it choked, this
92 will free up all of them in one call.
93
Andy Green0c9563b2013-06-10 22:54:40 +080094 - there's a new, optional callback LWS_CALLBACK_CLOSED_HTTP which gets
95 called when an HTTP protocol socket closes
96
Andy Green96d48fd2013-09-18 08:32:55 +080097 - for LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION callback, the user_space alloc
98 has already been done before the callback happens. That means we can
99 use the user parameter to the callback to contain the user pointer, and
100 move the protocol name to the "in" parameter. The docs for this
101 callback are also updated to reflect how to check headers in there.
102
Andy Green5dc62ea2013-09-20 20:26:12 +0800103 - libwebsocket_client_connect() is now properly nonblocking and async. See
104 README.coding and test-client.c for information on the callbacks you
105 can rely on controlling the async connection period with.
106
Andy Green81877e62013-10-26 20:36:08 +0800107 - if your OS does not support the http_proxy environment variable convention
108 (eg, reportedly OSX), you can use a new api libwebsocket_set_proxy()
109 to set the proxy details inbetween context creation and the connection
110 action. For OSes that support http_proxy, that's used automatically.
Andy Greenb55451c2013-03-16 12:32:27 +0800111
Andy Green50097dd2013-02-15 22:36:30 +0800112User api changes
113----------------
114
115 - the external poll callbacks now get the socket descriptor coming from the
116 "in" parameter. The user parameter provides the user_space for the
117 wsi as it normally does on the other callbacks.
Edwin van den Oetelaar8c8a8e12013-02-20 20:56:59 +0800118 LWS_CALLBACK_FILTER_NETWORK_CONNECTION also has the socket descriptor
119 delivered by @in now instead of @user.
Andy Green50097dd2013-02-15 22:36:30 +0800120
Andy Greenfc7c5e42013-02-23 10:50:10 +0800121 - libwebsocket_write() now returns -1 for error, or the amount of data
122 actually accepted for send. Under load, the OS may signal it is
123 ready to send new data on the socket, but have only a restricted
124 amount of memory to buffer the packet compared to usual.
125
Andy Green50097dd2013-02-15 22:36:30 +0800126
Andy Greendc914cf2013-02-18 16:54:26 +0800127User api removal
128----------------
129
130 - libwebsocket_ensure_user_space() is removed from the public api, if you
131 were using it to get user_space, you need to adapt your code to only
132 use user_space inside the user callback.
133
Andy Green2672fb22013-02-22 09:54:35 +0800134 - CIPHERS_LIST_STRING is removed
135
Andy Green0097a992013-03-09 13:06:37 +0800136 - autotools build has been removed. See README.build for info on how to
137 use CMake for your platform
138
Andy Green54cb3462013-02-14 22:23:54 +0800139
Andy Green53a46782013-02-14 11:23:49 +0800140v1.21-chrome26-firefox18
141========================
142
143 - Fixes buffer overflow bug in max frame size handling if you used the
144 default protocol buffer size. If you declared rx_buffer_size in your
145 protocol, which is recommended anyway, your code was unaffected.
146
Andy Green182cb9a2013-02-13 11:54:08 +0800147v1.2-chrome26-firefox18
148=======================
149
150Diffstat
151--------
152
153 .gitignore | 16 +++
154 CMakeLists.txt | 544 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
155 LICENSE | 526 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
156 Makefile.am | 1 +
157 README | 20 +++
158 README.build | 258 ++++++++++++++++++++++++++++++++-----
159 README.coding | 52 ++++++++
160 changelog | 136 ++++++++++++++++++++
161 cmake/FindOpenSSLbins.cmake | 33 +++++
162 config.h.cmake | 173 +++++++++++++++++++++++++
163 configure.ac | 22 +++-
164 lib/Makefile.am | 20 ++-
165 lib/base64-decode.c | 2 +-
166 lib/client-handshake.c | 190 +++++++++++-----------------
167 lib/client-parser.c | 88 +++++++------
168 lib/client.c | 384 ++++++++++++++++++++++++++++++-------------------------
169 lib/daemonize.c | 32 +++--
170 lib/extension-deflate-frame.c | 58 +++++----
171 lib/extension-deflate-stream.c | 19 ++-
172 lib/extension-deflate-stream.h | 4 +-
173 lib/extension.c | 11 +-
174 lib/getifaddrs.c | 315 +++++++++++++++++++++++-----------------------
175 lib/getifaddrs.h | 30 ++---
176 lib/handshake.c | 124 +++++++++++-------
177 lib/libwebsockets.c | 736 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------
178 lib/libwebsockets.h | 237 ++++++++++++++++++++++------------
179 lib/output.c | 192 +++++++++++-----------------
180 lib/parsers.c | 966 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------
181 lib/private-libwebsockets.h | 225 +++++++++++++++++++++------------
182 lib/server-handshake.c | 82 ++++++------
183 lib/server.c | 96 +++++++-------
184 libwebsockets-api-doc.html | 189 ++++++++++++++++++----------
185 libwebsockets.spec | 17 +--
186 test-server/attack.sh | 148 ++++++++++++++++++++++
187 test-server/test-client.c | 125 +++++++++---------
188 test-server/test-echo.c | 31 +++--
189 test-server/test-fraggle.c | 32 ++---
190 test-server/test-ping.c | 52 ++++----
191 test-server/test-server.c | 129 ++++++++++++-------
192 win32port/libwebsocketswin32/libwebsocketswin32.vcxproj | 279 ----------------------------------------
193 win32port/libwebsocketswin32/libwebsocketswin32.vcxproj.filters | 23 +++-
194 41 files changed, 4398 insertions(+), 2219 deletions(-)
195
Andy Green7b405452013-02-01 10:50:15 +0800196
197User api additions
198------------------
199
200 - lws_get_library_version() returns a const char * with a string like
201 "1.1 9e7f737", representing the library version from configure.ac
202 and the git HEAD hash the library was built from
203
Andy Greena47865f2013-02-10 09:39:47 +0800204 - TCP Keepalive can now optionally be applied to all lws sockets, on Linux
205 also with controllable timeout, number of probes and probe interval.
206 (On BSD type OS, you can only use system default settings for the
207 timing and retries, although enabling it is supported by setting
208 ka_time to nonzero, the exact value has no meaning.)
209 This enables detection of idle connections which are logically okay,
210 but are in fact dead, due to network connectivity issues at the server,
Andy Greena690cd02013-02-09 12:25:31 +0800211 client, or any intermediary. By default it's not enabled, but you
212 can enable it by setting a non-zero timeout (in seconds) at the new
213 ka_time member at context creation time.
214
Andy Greena7109e62013-02-11 12:05:54 +0800215 - Two new optional user callbacks added, LWS_CALLBACK_PROTOCOL_DESTROY which
216 is called one-time per protocol as the context is being destroyed, and
217 LWS_CALLBACK_PROTOCOL_INIT which is called when the context is created
218 and the protocols are added, again it's a one-time affair.
219 This lets you manage per-protocol allocations properly including
220 cleaning up after yourself when the server goes down.
Andy Green7b405452013-02-01 10:50:15 +0800221
Andy Greened334462013-02-07 21:14:33 +0800222User api changes
223----------------
224
Andy Green1b265272013-02-09 14:01:09 +0800225 - libwebsocket_create_context() has changed from taking a ton of parameters
226 to just taking a pointer to a struct containing the parameters. The
227 struct lws_context_creation_info is in libwebsockets.h, the members
228 are in the same order as when they were parameters to the call
229 previously. The test apps are all updated accordingly so you can
230 see example code there.
231
Andy Greened334462013-02-07 21:14:33 +0800232 - Header tokens are now deleted after the websocket connection is
Andy Green54495112013-02-06 21:10:16 +0900233 established. Not just the header data is saved, but the pointer and
234 length array is also removed from (union) scope saving several hundred
235 bytes per connection once it is established
236
237 - struct libwebsocket_protocols has a new member rx_buffer_size, this
238 controls rx buffer size per connection of that protocol now. Sources
239 for apps built against older versions of the library won't declare
240 this in their protocols, defaulting it to 0. Zero buffer is legal,
241 it causes a default buffer to be allocated (currently 4096)
242
243 If you want to receive only atomic frames in your user callback, you
244 should set this to greater than your largest frame size. If a frame
245 comes that exceeds that, no error occurs but the callback happens as
246 soon as the buffer limit is reached, and again if it is reached again
247 or the frame completes. You can detect that has happened by seeing
248 there is still frame content pending using
249 libwebsockets_remaining_packet_payload()
250
251 By correctly setting this, you can save a lot of memory when your
252 protocol has small frames (see the test server and client sources).
253
Andy Green16ab3182013-02-10 18:02:31 +0800254 - LWS_MAX_HEADER_LEN now defaults to 1024 and is the total amount of known
255 header payload lws can cope with, that includes the GET URL, origin
256 etc. Headers not understood by lws are ignored and their payload
257 not included in this.
258
Andy Green54495112013-02-06 21:10:16 +0900259
260User api removals
261-----------------
262
Andy Green16ab3182013-02-10 18:02:31 +0800263 - The configuration-time option MAX_USER_RX_BUFFER has been replaced by a
264 buffer size chosen per-protocol. For compatibility, there's a default
265 of 4096 rx buffer, but user code should set the appropriate size for
266 the protocol frames.
267
268 - LWS_INITIAL_HDR_ALLOC and LWS_ADDITIONAL_HDR_ALLOC are no longer needed
269 and have been removed. There's a new header management scheme that
270 handles them in a much more compact way.
Andy Greened334462013-02-07 21:14:33 +0800271
Andy Green70edd6f2013-02-12 10:15:25 +0800272 - libwebsockets_hangup_on_client() is removed. If you want to close the
273 connection you must do so from the user callback and by returning
274 -1 from there.
275
Andy Green508946c2013-02-12 10:19:08 +0800276 - libwebsocket_close_and_free_session() is now private to the library code
277 only and not exposed for user code. If you want to close the
278 connection, you must do so from the user callback by returning -1
279 from there.
280
Andy Greened334462013-02-07 21:14:33 +0800281
Andy Greendf60b0c2013-02-06 19:57:12 +0900282New features
283------------
284
Andy Green9b09dc02013-02-08 12:48:36 +0800285 - Cmake project file added, aimed initially at Windows support: this replaces
Andy Green16ab3182013-02-10 18:02:31 +0800286 the visual studio project files that were in the tree until now.
Andy Greendf60b0c2013-02-06 19:57:12 +0900287
Andy Greenc3ef0d62013-02-12 10:50:49 +0800288 - CyaSSL now supported in place of OpenSSL (--use-cyassl on configure)
289
Andy Green9b09dc02013-02-08 12:48:36 +0800290 - PATH_MAX or MAX_PATH no longer needed
Andy Greendf60b0c2013-02-06 19:57:12 +0900291
Andy Green54495112013-02-06 21:10:16 +0900292 - cutomizable frame rx buffer size by protocol
293
Andy Greenc3ef0d62013-02-12 10:50:49 +0800294 - optional TCP keepalive so dead peers can be detected, can be enabled at
295 context-creation time
296
297 - valgrind-clean: no SSL or CyaSSL: completely clean. With OpenSSL, 88 bytes
298 lost at OpenSSL library init and symptomless reports of uninitialized
299 memory usage... seems to be a known and ignored problem at OpenSSL
300
Andy Greena3957ef2013-02-11 09:31:43 +0800301 - By default debug is enabled and the library is built for -O0 -g to faclitate
302 that. Use --disable-debug configure option to build instead with -O4
303 and no -g (debug info), obviously providing best performance and
304 reduced binary size.
Andy Green7b405452013-02-01 10:50:15 +0800305
Andy Green895d56d2013-02-11 09:32:53 +0800306 - 1.0 introduced some code to try to not deflate small frames, however this
307 seems to break when confronted with a mixture of frames above and
308 below the threshold, so it's removed. Veto the compression extension
309 in your user callback if you will typically have very small frames.
310
Andy Green16ab3182013-02-10 18:02:31 +0800311 - There are many memory usage improvements, both a reduction in malloc/
312 realloc and architectural changes. A websocket connection now
313 consumes only 296 bytes with SSL or 272 bytes without on x86_64,
314 during header processing an additional 1262 bytes is allocated in a
315 single malloc, but is freed when the websocket connection starts.
316 The RX frame buffer defined by the protocol in user
317 code is also allocated per connection, this represents the largest
318 frame you can receive atomically in that protocol.
319
Andy Greenc3ef0d62013-02-12 10:50:49 +0800320 - On ARM9 build, just http+ws server no extensions or ssl, <12Kbytes .text
321 and 112 bytes per connection (+1328 only during header processing)
322
Andy Green895d56d2013-02-11 09:32:53 +0800323
Andy Greenbd1132f2013-01-31 19:53:05 +0800324v1.1-chrome26-firefox18
Andy Greena35c86f2013-01-31 10:16:44 +0800325=======================
326
327Diffstat
328--------
329
330 Makefile.am | 4 +
331 README-test-server | 291 ---
332 README.build | 239 ++
333 README.coding | 138 ++
334 README.rst | 72 -
335 README.test-apps | 272 +++
336 configure.ac | 116 +-
337 lib/Makefile.am | 55 +-
338 lib/base64-decode.c | 5 +-
339 lib/client-handshake.c | 121 +-
340 lib/client-parser.c | 394 ++++
341 lib/client.c | 807 +++++++
342 lib/daemonize.c | 212 ++
343 lib/extension-deflate-frame.c | 132 +-
344 lib/extension-deflate-stream.c | 12 +-
345 lib/extension-x-google-mux.c | 1223 ----------
346 lib/extension-x-google-mux.h | 96 -
347 lib/extension.c | 8 -
348 lib/getifaddrs.c | 271 +++
349 lib/getifaddrs.h | 76 +
350 lib/handshake.c | 582 +----
351 lib/libwebsockets.c | 2493 ++++++---------------
352 lib/libwebsockets.h | 115 +-
353 lib/md5.c | 217 --
354 lib/minilex.c | 440 ++++
355 lib/output.c | 628 ++++++
356 lib/parsers.c | 2016 +++++------------
357 lib/private-libwebsockets.h | 284 +--
358 lib/server-handshake.c | 275 +++
359 lib/server.c | 377 ++++
360 libwebsockets-api-doc.html | 300 +--
361 m4/ignore-me | 2 +
362 test-server/Makefile.am | 111 +-
363 test-server/libwebsockets.org-logo.png | Bin 0 -> 7029 bytes
364 test-server/test-client.c | 45 +-
365 test-server/test-echo.c | 330 +++
366 test-server/test-fraggle.c | 20 +-
367 test-server/test-ping.c | 22 +-
368 test-server/test-server-extpoll.c | 554 -----
369 test-server/test-server.c | 349 ++-
370 test-server/test.html | 3 +-
371 win32port/zlib/ZLib.vcxproj | 749 ++++---
372 win32port/zlib/ZLib.vcxproj.filters | 188 +-
373 win32port/zlib/adler32.c | 348 ++-
374 win32port/zlib/compress.c | 160 +-
375 win32port/zlib/crc32.c | 867 ++++----
376 win32port/zlib/crc32.h | 882 ++++----
377 win32port/zlib/deflate.c | 3799 +++++++++++++++-----------------
378 win32port/zlib/deflate.h | 688 +++---
379 win32port/zlib/gzclose.c | 50 +-
380 win32port/zlib/gzguts.h | 325 ++-
381 win32port/zlib/gzlib.c | 1157 +++++-----
382 win32port/zlib/gzread.c | 1242 ++++++-----
383 win32port/zlib/gzwrite.c | 1096 +++++----
384 win32port/zlib/infback.c | 1272 ++++++-----
385 win32port/zlib/inffast.c | 680 +++---
386 win32port/zlib/inffast.h | 22 +-
387 win32port/zlib/inffixed.h | 188 +-
388 win32port/zlib/inflate.c | 2976 +++++++++++++------------
389 win32port/zlib/inflate.h | 244 +-
390 win32port/zlib/inftrees.c | 636 +++---
391 win32port/zlib/inftrees.h | 124 +-
392 win32port/zlib/trees.c | 2468 +++++++++++----------
393 win32port/zlib/trees.h | 256 +--
394 win32port/zlib/uncompr.c | 118 +-
395 win32port/zlib/zconf.h | 934 ++++----
396 win32port/zlib/zlib.h | 3357 ++++++++++++++--------------
397 win32port/zlib/zutil.c | 642 +++---
398 win32port/zlib/zutil.h | 526 ++---
399 69 files changed, 19556 insertions(+), 20145 deletions(-)
400
401user api changes
402----------------
403
404 - libwebsockets_serve_http_file() now takes a context as first argument
405
406 - libwebsockets_get_peer_addresses() now takes a context and wsi as first
407 two arguments
408
409
410user api additions
411------------------
412
413 - lwsl_...() logging apis, default to stderr but retargetable by user code;
414 may be used also by user code
415
416 - lws_set_log_level() set which logging apis are able to emit (defaults to
417 notice, warn, err severities), optionally set the emit callback
418
419 - lwsl_emit_syslog() helper callback emits to syslog
420
421 - lws_daemonize() helper code that forks the app into a headless daemon
422 properly, maintains a lock file with pid in suitable for sysvinit etc to
423 control lifecycle
424
425 - LWS_CALLBACK_HTTP_FILE_COMPLETION callback added since http file
426 transfer is now asynchronous (see test server code)
427
428 - lws_frame_is_binary() from a wsi pointer, let you know if the received
429 data was sent in BINARY mode
430
431
432user api removals
433-----------------
434
435 - libwebsockets_fork_service_loop() - no longer supported (had intractable problems)
436 arrange your code to act from the user callback instead from same
437 process context as the service loop
438
439 - libwebsockets_broadcast() - use libwebsocket_callback_on_writable[_all_protocol]()
440 instead from same process context as the service loop. See the test apps
441 for examples.
442
443 - x-google-mux() removed until someone wants it
444
445 - pre -v13 (ancient) protocol support removed
446
447
448New features
449------------
450
451 - echo test server and client compatible with echo.websocket.org added
452
453 - many new configure options (see README.build) to reduce footprint of the
454 library to what you actually need, eg, --without-client and
455 --without-server
456
457 - http + websocket server can build to as little as 12K .text for ARM
458
459 - no more MAX_CLIENTS limitation; adapts to support the max number of fds
460 allowed to the process by ulimit, defaults to 1024 on Fedora and
461 Ubuntu. Use ulimit to control this without needing to configure
462 the library. Code here is smaller and faster.
463
464 - adaptive ratio of listen socket to connection socket service allows
465 good behaviour under Apache ab test load. Tested with thousands
466 of simultaneous connections
467
468 - reduction in per-connection memory footprint by moving to a union to hold
469 mutually-exclusive state for the connection
470
471 - robustness: Out of Memory taken care of for all allocation code now
472
473 - internal getifaddrs option if your toolchain lacks it (some uclibc)
474
475 - configurable memory limit for deflate operations
476
477 - improvements in SSL code nonblocking operation, possible hang solved,
478 some SSL operations broken down into pollable states so there is
479 no library blocking, timeout coverage for SSL_connect
480
481 - extpoll test server merged into single test server source
482
483 - robustness: library should deal with all recoverable socket conditions
484
485 - rx flowcontrol for backpressure notification fixed and implmeneted
486 correctly in the test server
487
488 - optimal lexical parser added for header processing; all headers in a
489 single 276-byte state table
490
491 - latency tracking api added (configure --with-latency)
492
493 - Improved in-tree documentation, REAME.build, README.coding,
494 README.test-apps, changelog
495
496 - Many small fixes
497
498
499v1.0-chrome25-firefox17 (6cd1ea9b005933f)