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