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