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