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