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