changelog explain protocols related api changes
[platform/upstream/libwebsockets.git] / changelog
1 Changelog
2 ---------
3
4 User api additions
5 ------------------
6
7 lws now exposes his internal platform file abstraction in a way that can be
8 both used by user code to make it platform-agnostic, and be overridden or
9 subclassed by user code.  This allows things like handling the URI "directory
10 space" as a virtual filesystem that may or may not be backed by a regular
11 filesystem.  One example use is serving files from inside large compressed
12 archive storage without having to unpack anything except the file being
13 requested.
14
15 The test server shows how to use it, basically the platform-specific part of
16 lws prepares a file operations structure that lives in the lws context.
17
18 The user code can get a pointer to the file operations struct
19
20 LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops *
21 lws_get_fops(struct lws_context *context);
22
23 and then can use it with helpers to also leverage these platform-independent
24 file handling apis
25
26 static inline lws_filefd_type
27 lws_plat_file_open(struct lws_plat_file_ops *fops, const char *filename,
28                    unsigned long *filelen, int flags)
29
30 static inline int
31 lws_plat_file_close(struct lws_plat_file_ops *fops, lws_filefd_type fd)
32
33 static inline unsigned long
34 lws_plat_file_seek_cur(struct lws_plat_file_ops *fops, lws_filefd_type fd,
35                        long offset_from_cur_pos)
36
37 static inline int
38 lws_plat_file_read(struct lws_plat_file_ops *fops, lws_filefd_type fd,
39                    unsigned long *amount, unsigned char *buf, unsigned long len)
40
41 static inline int
42 lws_plat_file_write(struct lws_plat_file_ops *fops, lws_filefd_type fd,
43                     unsigned long *amount, unsigned char *buf, unsigned long len)
44                     
45 The user code can also override or subclass the file operations, to either
46 wrap or replace them.  An example is shown in test server.
47
48
49 User api changes
50 ----------------
51
52 1) Three APIS
53
54  - lws_callback_on_writable_all_protocol(const struct lws_protocols *protocol)
55  - lws_callback_all_protocol(const struct lws_protocols *protocol)
56  - lws_rx_flow_allow_all_protocol(lws_rx_flow_allow_all_protocol)
57
58 Now take an additional pointer to the lws_context in their first argument.
59
60 The reason for this change is struct lws_protocols has been changed to remove
61 members that lws used for private storage: so the protocols struct in now
62 truly const and may be reused serially or simultaneously by different contexts.
63
64 2) Several older apis start with libwebsocket_ or libwebsockets_ while newer ones
65 all begin lws_.  These apis have been changed to all begin with lws_.
66
67 However except for the three APIs mentioned above in 1), compatibility defines
68 have been added in libwebsockets.h, so it is largely build-compatible with
69 older sources using the old api names.
70
71 If you are using lws with a distro, or otherwise can't rebuild the user code,
72 you should add 
73
74  -DLWS_WITH_OLD_API_WRAPPERS=1
75
76 to your cmake args.  This builds lws with all the old apis as wrappers around
77 the new apis, so the library still exports the old apis.
78
79 In this way you can have lws export both the new and old apis simultaneously
80 for compatibility.
81
82
83 v1.5-chrome47-firefox41
84 =======================
85
86 User api changes
87 ----------------
88
89 LWS_CALLBACK_CLIENT_CONNECTION_ERROR may provide an error string if in is
90 non-NULL.  If so, the string has length len.
91
92 LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED is available to relax the requirement
93 for peer certs if you are using the option to require client certs.
94
95 LWS_WITHOUT_BUILTIN_SHA1 cmake option forces lws to use SHA1() defined
96 externally, eg, byOpenSSL, and disables build of libwebsockets_SHA1()
97
98
99 v1.4-chrome43-firefox36
100 =======================
101
102 User api additions
103 ------------------
104
105 There's a new member in the info struct used to control context creation,
106 ssl_private_key_password, which allows passing into lws the passphrase on
107 an SSL cetificate
108
109 There's a new member in struct protocols, id, which is ignored by lws but can
110 be used by the user code to mark the selected protocol by user-defined version
111 or capabliity flag information, for the case multiple versions of a protocol are
112 supported.
113
114 int lws_is_ssl(wsi) added to allow user code to know if the connection was made
115 over ssl or not.  If LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT is used, both
116 ssl and non-ssl connections are possible and may need to be treated differently
117 in the user code.
118
119 int lws_partial_buffered(wsi) added... should be checked after any
120 libwebsocket_write that will be followed by another libwebsocket_write inside
121 the same writeable callback.  If set, you can't do any more writes until the
122 writeable callback is called again.  If you only do one write per writeable callback,
123 you can ignore this.
124
125 HTTP2-related: HTTP2 changes how headers are handled, lws now has new version-
126 agnositic header creation APIs.  These do the right thing depending on each
127 connection's HTTP version without the user code having to know or care, except
128 to make sure to use the new APIs for headers (test-server is updated to use
129 them already, so look there for examples)
130
131 The APIs "render" the headers into a user-provided buffer and bump *p as it
132 is used.  If *p reaches end, then the APIs return nonzero for error.
133
134 LWS_VISIBLE LWS_EXTERN int
135 lws_add_http_header_status(struct libwebsocket_context *context,
136                             struct libwebsocket *wsi,
137                             unsigned int code,
138                             unsigned char **p,
139                             unsigned char *end);
140
141 Start a response header reporting status like 200, 500, etc
142
143 LWS_VISIBLE LWS_EXTERN int
144 lws_add_http_header_by_name(struct libwebsocket_context *context,
145                             struct libwebsocket *wsi,
146                             const unsigned char *name,
147                             const unsigned char *value,
148                             int length,
149                             unsigned char **p,
150                             unsigned char *end);
151
152 Add a header like name: value in HTTP1.x
153
154 LWS_VISIBLE LWS_EXTERN int 
155 lws_finalize_http_header(struct libwebsocket_context *context,
156                             struct libwebsocket *wsi,
157                             unsigned char **p,
158                             unsigned char *end);
159
160 Finish off the headers, like add the extra \r\n in HTTP1.x
161
162 LWS_VISIBLE LWS_EXTERN int
163 lws_add_http_header_by_token(struct libwebsocket_context *context,
164                             struct libwebsocket *wsi,
165                             enum lws_token_indexes token,
166                             const unsigned char *value,
167                             int length,
168                             unsigned char **p,
169                             unsigned char *end);
170
171 Add a header by using a lws token as the name part.  In HTTP2, this can be
172 compressed to one or two bytes.
173
174
175 User api removal
176 ----------------
177
178 protocols struct member no_buffer_all_partial_tx is removed.  Under some
179 conditions like rewriting extension such as compression in use, the built-in
180 partial send buffering is the only way to deal with the problem, so turning
181 it off is deprecated.
182
183
184 User api changes
185 ----------------
186
187 HTTP2-related: API libwebsockets_serve_http_file() takes an extra parameter at
188 the end now
189
190 int other_headers_len)
191
192 If you are providing other headers, they must be generated using the new
193 HTTP-version-agnostic APIs, and you must provide the length of them using this
194 additional parameter.
195
196 struct lws_context_creation_info now has an additional member
197 SSL_CTX *provided_client_ssl_ctx you may set to an externally-initialized
198 SSL_CTX managed outside lws.  Defaulting to zero keeps the existing behaviour of
199 lws managing the context, if you memset the struct to 0 or have as a filescope
200 initialized struct in bss, no need to change anything.
201
202
203 v1.3-chrome37-firefox30
204 =======================
205
206  .gitignore                                               |    1 -
207  CMakeLists.txt                                           |  447 +++--
208  README.build                                             |   35 +-
209  README.coding                                            |   14 +
210  changelog                                                |   66 +
211  cmake/LibwebsocketsConfig.cmake.in                       |   17 +
212  cmake/LibwebsocketsConfigVersion.cmake.in                |   11 +
213  config.h.cmake                                           |   18 +
214  cross-ming.cmake                                         |   31 +
215  cross-openwrt-makefile                                   |   91 +
216  lib/client-handshake.c                                   |  205 ++-
217  lib/client-parser.c                                      |   58 +-
218  lib/client.c                                             |  158 +-
219  lib/context.c                                            |  341 ++++
220  lib/extension-deflate-frame.c                            |    2 +-
221  lib/extension.c                                          |  178 ++
222  lib/handshake.c                                          |  287 +---
223  lib/lextable.h                                           |  338 ++++
224  lib/libev.c                                              |  175 ++
225  lib/libwebsockets.c                                      | 2089 +++--------------------
226  lib/libwebsockets.h                                      |  253 ++-
227  lib/lws-plat-unix.c                                      |  404 +++++
228  lib/lws-plat-win.c                                       |  358 ++++
229  lib/minilex.c                                            |  530 +++---
230  lib/output.c                                             |  445 ++---
231  lib/parsers.c                                            |  682 ++++----
232  lib/pollfd.c                                             |  239 +++
233  lib/private-libwebsockets.h                              |  501 +++++-
234  lib/server-handshake.c                                   |  274 +--
235  lib/server.c                                             |  858 ++++++++--
236  lib/service.c                                            |  517 ++++++
237  lib/sha-1.c                                              |   38 +-
238  lib/ssl-http2.c                                          |   78 +
239  lib/ssl.c                                                |  571 +++++++
240  test-server/attack.sh                                    |  101 +-
241  test-server/test-client.c                                |    9 +-
242  test-server/test-echo.c                                  |   17 +-
243  test-server/test-fraggle.c                               |    7 -
244  test-server/test-ping.c                                  |   12 +-
245  test-server/test-server.c                                |  330 ++--
246  test-server/test.html                                    |    4 +-
247  win32port/client/client.vcxproj                          |  259 ---
248  win32port/client/client.vcxproj.filters                  |   39 -
249  .../libwebsocketswin32.vcxproj.filters                   |   93 -
250  win32port/server/server.vcxproj                          |  276 ---
251  win32port/server/server.vcxproj.filters                  |   51 -
252  win32port/win32helpers/gettimeofday.h                    |   59 +-
253  win32port/win32helpers/netdb.h                           |    1 -
254  win32port/win32helpers/strings.h                         |    0
255  win32port/win32helpers/sys/time.h                        |    1 -
256  win32port/win32helpers/unistd.h                          |    0
257  win32port/win32helpers/websock-w32.c                     |  104 --
258  win32port/win32helpers/websock-w32.h                     |   62 -
259  win32port/win32port.sln                                  |  100 --
260  win32port/zlib/gzio.c                                    |    3 +-
261  55 files changed, 6779 insertions(+), 5059 deletions(-)
262
263
264 User api additions
265 ------------------
266
267 POST method is supported
268
269 The protocol 0 / HTTP callback can now get two new kinds of callback,
270 LWS_CALLBACK_HTTP_BODY (in and len are a chunk of the body of the HTTP request)
271 and LWS_CALLBACK_HTTP_BODY_COMPLETION (the expected amount of body has arrived
272 and been passed to the user code already).  These callbacks are used with the
273 post method (see the test server for details).
274
275 The period between the HTTP header completion and the completion of the body
276 processing is protected by a 5s timeout.
277
278 The chunks are stored in a malloc'd buffer of size protocols[0].rx_buffer_size.
279
280
281 New server option you can enable from user code
282 LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT allows non-SSL connections to
283 also be accepted on an SSL listening port.  It's disabled unless you enable
284 it explicitly.
285
286
287 Two new callbacks are added in protocols[0] that are optional for allowing
288 limited thread access to libwebsockets, LWS_CALLBACK_LOCK_POLL and
289 LWS_CALLBACK_UNLOCK_POLL.
290
291 If you use them, they protect internal and external poll list changes, but if
292 you want to use external thread access to libwebsocket_callback_on_writable()
293 you have to implement your locking here even if you don't use external
294 poll support.
295
296 If you will use another thread for this, take a lot of care about managing
297 your list of live wsi by doing it from ESTABLISHED and CLOSED callbacks
298 (with your own locking).
299
300 If you configure cmake with -DLWS_WITH_LIBEV=1 then the code allowing the libev
301 eventloop instead of the default poll() one will also be compiled in.  But to
302 use it, you must also set the LWS_SERVER_OPTION_LIBEV flag on the context
303 creation info struct options member.
304
305 IPV6 is supported and enabled by default except for Windows, you can disable
306 the support at build-time by giving -DLWS_IPV6=, and disable use of it even if
307 compiled in by making sure the flag LWS_SERVER_OPTION_DISABLE_IPV6 is set on
308 the context creation info struct options member.
309
310 You can give LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS option flag to
311 guarantee the OS CAs will not be used, even if that support was selected at
312 build-time.
313
314 Optional "token limits" may be enforced by setting the member "token_limits"
315 in struct lws_context_creation_info to point to a struct lws_token_limits.
316 NULL means no token limits used for compatibility.
317
318
319 User api changes
320 ----------------
321
322 Extra optional argument to libwebsockets_serve_http_file() allows injecion
323 of HTTP headers into the canned response.  Eg, cookies may be added like
324 that without getting involved in having to send the header by hand.
325
326 A new info member http_proxy_address may be used at context creation time to
327 set the http proxy.  If non-NULL, it overrides http_proxy environment var.
328
329 Cmake supports LWS_SSL_CLIENT_USE_OS_CA_CERTS defaulting to on, which gets
330 the client to use the OS CA Roots.  If you're worried somebody with the
331 ability to forge for force creation of a client cert from the root CA in
332 your OS, you should disable this since your selfsigned $0 cert is a lot safer
333 then...
334
335
336 v1.23-chrome32-firefox24
337 ========================
338
339  Android.mk                            |   29 +
340  CMakeLists.txt                        |  573 ++++++++----
341  COPYING                               |  503 -----------
342  INSTALL                               |  365 --------
343  Makefile.am                           |   13 -
344  README.build                          |  371 ++------
345  README.coding                         |   63 ++
346  autogen.sh                            | 1578 ---------------------------------
347  changelog                             |   69 ++
348  cmake/FindGit.cmake                   |  163 ++++
349  cmake/FindOpenSSLbins.cmake           |   15 +-
350  cmake/UseRPMTools.cmake               |  176 ++++
351  config.h.cmake                        |   25 +-
352  configure.ac                          |  226 -----
353  cross-arm-linux-gnueabihf.cmake       |   28 +
354  lib/Makefile.am                       |   89 --
355  lib/base64-decode.c                   |   98 +-
356  lib/client-handshake.c                |  123 ++-
357  lib/client-parser.c                   |   19 +-
358  lib/client.c                          |  145 ++-
359  lib/daemonize.c                       |    4 +-
360  lib/extension.c                       |    2 +-
361  lib/getifaddrs.h                      |    4 +-
362  lib/handshake.c                       |   76 +-
363  lib/libwebsockets.c                   |  491 ++++++----
364  lib/libwebsockets.h                   |  164 ++--
365  lib/output.c                          |  214 ++++-
366  lib/parsers.c                         |  102 +--
367  lib/private-libwebsockets.h           |   66 +-
368  lib/server-handshake.c                |    5 +-
369  lib/server.c                          |   29 +-
370  lib/sha-1.c                           |    2 +-
371  libwebsockets-api-doc.html            |  249 +++---
372  libwebsockets.pc.in                   |   11 -
373  libwebsockets.spec                    |   14 +-
374  m4/ignore-me                          |    2 -
375  scripts/FindLibWebSockets.cmake       |   33 +
376  scripts/kernel-doc                    |    1 +
377  test-server/Makefile.am               |  131 ---
378  test-server/leaf.jpg                  |  Bin 0 -> 2477518 bytes
379  test-server/test-client.c             |   78 +-
380  test-server/test-echo.c               |   33 +-
381  test-server/test-fraggle.c            |   26 +-
382  test-server/test-ping.c               |   15 +-
383  test-server/test-server.c             |  197 +++-
384  test-server/test.html                 |    5 +-
385  win32port/win32helpers/gettimeofday.c |   74 +-
386  win32port/win32helpers/websock-w32.h  |    6 +-
387  48 files changed, 2493 insertions(+), 4212 deletions(-)
388
389
390 User api additions
391 ------------------
392
393  - You can now call libwebsocket_callback_on_writable() on http connectons,
394         and get a LWS_CALLBACK_HTTP_WRITEABLE callback, the same way you can
395         regulate writes with a websocket protocol connection.
396
397  - A new member in the context creation parameter struct "ssl_cipher_list" is
398         added, replacing CIPHERS_LIST_STRING.  NULL means use the ssl library
399         default list of ciphers.
400
401  - Not really an api addition, but libwebsocket_service_fd() will now zero
402         the revents field of the pollfd it was called with if it handled the
403         descriptor.  So you can tell if it is a non-lws fd by checking revents
404         after the service call... if it's still nonzero, the descriptor
405         belongs to you and you need to take care of it.
406
407  - libwebsocket_rx_flow_allow_all_protocol(protocol) will unthrottle all
408         connections with the established protocol.  It's designed to be
409         called from user server code when it sees it can accept more input
410         and may have throttled connections using the server rx flow apis
411         while it was unable to accept any other input  The user server code
412         then does not have to try to track while connections it choked, this
413         will free up all of them in one call.
414
415  - there's a new, optional callback LWS_CALLBACK_CLOSED_HTTP which gets
416         called when an HTTP protocol socket closes
417
418  - for LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION callback, the user_space alloc
419         has already been done before the callback happens.  That means we can
420         use the user parameter to the callback to contain the user pointer, and
421         move the protocol name to the "in" parameter.  The docs for this
422         callback are also updated to reflect how to check headers in there.
423
424  - libwebsocket_client_connect() is now properly nonblocking and async.  See
425         README.coding and test-client.c for information on the callbacks you
426         can rely on controlling the async connection period with.
427
428  - if your OS does not support the http_proxy environment variable convention
429         (eg, reportedly OSX), you can use a new api libwebsocket_set_proxy()
430         to set the proxy details in between context creation and the connection
431         action.  For OSes that support http_proxy, that's used automatically.
432
433 User api changes
434 ----------------
435
436  - the external poll callbacks now get the socket descriptor coming from the
437         "in" parameter.  The user parameter provides the user_space for the
438         wsi as it normally does on the other callbacks.
439         LWS_CALLBACK_FILTER_NETWORK_CONNECTION also has the socket descriptor
440         delivered by @in now instead of @user.
441
442  - libwebsocket_write() now returns -1 for error, or the amount of data
443         actually accepted for send.  Under load, the OS may signal it is
444         ready to send new data on the socket, but have only a restricted
445         amount of memory to buffer the packet compared to usual.
446
447
448 User api removal
449 ----------------
450
451  - libwebsocket_ensure_user_space() is removed from the public api, if you
452         were using it to get user_space, you need to adapt your code to only
453         use user_space inside the user callback.
454
455  - CIPHERS_LIST_STRING is removed
456
457  - autotools build has been removed.  See README.build for info on how to
458         use CMake for your platform
459
460
461 v1.21-chrome26-firefox18
462 ========================
463
464  - Fixes buffer overflow bug in max frame size handling if you used the
465         default protocol buffer size.  If you declared rx_buffer_size in your
466         protocol, which is recommended anyway, your code was unaffected.
467
468 v1.2-chrome26-firefox18
469 =======================
470
471 Diffstat
472 --------
473
474  .gitignore                                                      |  16 +++
475  CMakeLists.txt                                                  | 544 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
476  LICENSE                                                         | 526 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
477  Makefile.am                                                     |   1 +
478  README                                                          |  20 +++
479  README.build                                                    | 258 ++++++++++++++++++++++++++++++++-----
480  README.coding                                                   |  52 ++++++++
481  changelog                                                       | 136 ++++++++++++++++++++
482  cmake/FindOpenSSLbins.cmake                                     |  33 +++++
483  config.h.cmake                                                  | 173 +++++++++++++++++++++++++
484  configure.ac                                                    |  22 +++-
485  lib/Makefile.am                                                 |  20 ++-
486  lib/base64-decode.c                                             |   2 +-
487  lib/client-handshake.c                                          | 190 +++++++++++-----------------
488  lib/client-parser.c                                             |  88 +++++++------
489  lib/client.c                                                    | 384 ++++++++++++++++++++++++++++++-------------------------
490  lib/daemonize.c                                                 |  32 +++--
491  lib/extension-deflate-frame.c                                   |  58 +++++----
492  lib/extension-deflate-stream.c                                  |  19 ++-
493  lib/extension-deflate-stream.h                                  |   4 +-
494  lib/extension.c                                                 |  11 +-
495  lib/getifaddrs.c                                                | 315 +++++++++++++++++++++++-----------------------
496  lib/getifaddrs.h                                                |  30 ++---
497  lib/handshake.c                                                 | 124 +++++++++++-------
498  lib/libwebsockets.c                                             | 736 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------
499  lib/libwebsockets.h                                             | 237 ++++++++++++++++++++++------------
500  lib/output.c                                                    | 192 +++++++++++-----------------
501  lib/parsers.c                                                   | 966 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------
502  lib/private-libwebsockets.h                                     | 225 +++++++++++++++++++++------------
503  lib/server-handshake.c                                          |  82 ++++++------
504  lib/server.c                                                    |  96 +++++++-------
505  libwebsockets-api-doc.html                                      | 189 ++++++++++++++++++----------
506  libwebsockets.spec                                              |  17 +--
507  test-server/attack.sh                                           | 148 ++++++++++++++++++++++
508  test-server/test-client.c                                       | 125 +++++++++---------
509  test-server/test-echo.c                                         |  31 +++--
510  test-server/test-fraggle.c                                      |  32 ++---
511  test-server/test-ping.c                                         |  52 ++++----
512  test-server/test-server.c                                       | 129 ++++++++++++-------
513  win32port/libwebsocketswin32/libwebsocketswin32.vcxproj         | 279 ----------------------------------------
514  win32port/libwebsocketswin32/libwebsocketswin32.vcxproj.filters |  23 +++-
515  41 files changed, 4398 insertions(+), 2219 deletions(-)
516
517
518 User api additions
519 ------------------
520
521  - lws_get_library_version() returns a const char * with a string like
522          "1.1 9e7f737", representing the library version from configure.ac
523          and the git HEAD hash the library was built from
524
525  - TCP Keepalive can now optionally be applied to all lws sockets, on Linux
526         also with controllable timeout, number of probes and probe interval.
527         (On BSD type OS, you can only use system default settings for the
528         timing and retries, although enabling it is supported by setting
529         ka_time to nonzero, the exact value has no meaning.)
530         This enables detection of idle connections which are logically okay,
531         but are in fact dead, due to network connectivity issues at the server,
532         client, or any intermediary.  By default it's not enabled, but you
533         can enable it by setting a non-zero timeout (in seconds) at the new
534         ka_time member at context creation time.
535
536  - Two new optional user callbacks added, LWS_CALLBACK_PROTOCOL_DESTROY which
537         is called one-time per protocol as the context is being destroyed, and
538         LWS_CALLBACK_PROTOCOL_INIT which is called when the context is created
539         and the protocols are added, again it's a one-time affair.
540         This lets you manage per-protocol allocations properly including
541         cleaning up after yourself when the server goes down.
542
543 User api changes
544 ----------------
545
546  - libwebsocket_create_context() has changed from taking a ton of parameters
547         to just taking a pointer to a struct containing the parameters.  The
548         struct lws_context_creation_info is in libwebsockets.h, the members
549         are in the same order as when they were parameters to the call
550         previously.  The test apps are all updated accordingly so you can
551         see example code there.
552
553  - Header tokens are now deleted after the websocket connection is
554         established.  Not just the header data is saved, but the pointer and
555         length array is also removed from (union) scope saving several hundred
556         bytes per connection once it is established
557
558  - struct libwebsocket_protocols has a new member rx_buffer_size, this
559         controls rx buffer size per connection of that protocol now.  Sources
560         for apps built against older versions of the library won't declare
561         this in their protocols, defaulting it to 0.  Zero buffer is legal,
562         it causes a default buffer to be allocated (currently 4096)
563
564         If you want to receive only atomic frames in your user callback, you
565         should set this to greater than your largest frame size.  If a frame
566         comes that exceeds that, no error occurs but the callback happens as
567         soon as the buffer limit is reached, and again if it is reached again
568         or the frame completes.  You can detect that has happened by seeing
569         there is still frame content pending using
570         libwebsockets_remaining_packet_payload()
571
572         By correctly setting this, you can save a lot of memory when your
573         protocol has small frames (see the test server and client sources).
574
575  - LWS_MAX_HEADER_LEN now defaults to 1024 and is the total amount of known
576         header payload lws can cope with, that includes the GET URL, origin
577         etc.  Headers not understood by lws are ignored and their payload
578         not included in this.
579
580
581 User api removals
582 -----------------
583
584  - The configuration-time option MAX_USER_RX_BUFFER has been replaced by a
585         buffer size chosen per-protocol.  For compatibility, there's a default
586         of 4096 rx buffer, but user code should set the appropriate size for
587         the protocol frames.
588
589  - LWS_INITIAL_HDR_ALLOC and LWS_ADDITIONAL_HDR_ALLOC are no longer needed
590         and have been removed.  There's a new header management scheme that
591         handles them in a much more compact way.
592
593  - libwebsockets_hangup_on_client() is removed.  If you want to close the
594         connection you must do so from the user callback and by returning
595         -1 from there.
596
597  - libwebsocket_close_and_free_session() is now private to the library code
598         only and not exposed for user code.  If you want to close the
599         connection, you must do so from the user callback by returning -1
600         from there.
601
602
603 New features
604 ------------
605
606  - Cmake project file added, aimed initially at Windows support: this replaces
607         the visual studio project files that were in the tree until now.
608
609  - CyaSSL now supported in place of OpenSSL (--use-cyassl on configure)
610
611  - PATH_MAX or MAX_PATH no longer needed
612
613  - cutomizable frame rx buffer size by protocol
614
615  - optional TCP keepalive so dead peers can be detected, can be enabled at
616         context-creation time
617
618  - valgrind-clean: no SSL or CyaSSL: completely clean.  With OpenSSL, 88 bytes
619         lost at OpenSSL library init and symptomless reports of uninitialized
620         memory usage... seems to be a known and ignored problem at OpenSSL
621
622  - By default debug is enabled and the library is built for -O0 -g to faclitate
623         that.  Use --disable-debug configure option to build instead with -O4
624         and no -g (debug info), obviously providing best performance and
625         reduced binary size.
626
627  - 1.0 introduced some code to try to not deflate small frames, however this
628         seems to break when confronted with a mixture of frames above and
629         below the threshold, so it's removed.  Veto the compression extension
630         in your user callback if you will typically have very small frames.
631
632  - There are many memory usage improvements, both a reduction in malloc/
633         realloc and architectural changes.  A websocket connection now
634         consumes only 296 bytes with SSL or 272 bytes without on x86_64,
635         during header processing an additional 1262 bytes is allocated in a
636         single malloc, but is freed when the websocket connection starts.
637         The RX frame buffer defined by the protocol in user
638         code is also allocated per connection, this represents the largest
639         frame you can receive atomically in that protocol.
640
641  - On ARM9 build, just http+ws server no extensions or ssl, <12Kbytes .text
642         and 112 bytes per connection (+1328 only during header processing)
643
644
645 v1.1-chrome26-firefox18
646 =======================
647
648 Diffstat
649 --------
650
651  Makefile.am                            |    4 +
652  README-test-server                     |  291 ---
653  README.build                           |  239 ++
654  README.coding                          |  138 ++
655  README.rst                             |   72 -
656  README.test-apps                       |  272 +++
657  configure.ac                           |  116 +-
658  lib/Makefile.am                        |   55 +-
659  lib/base64-decode.c                    |    5 +-
660  lib/client-handshake.c                 |  121 +-
661  lib/client-parser.c                    |  394 ++++
662  lib/client.c                           |  807 +++++++
663  lib/daemonize.c                        |  212 ++
664  lib/extension-deflate-frame.c          |  132 +-
665  lib/extension-deflate-stream.c         |   12 +-
666  lib/extension-x-google-mux.c           | 1223 ----------
667  lib/extension-x-google-mux.h           |   96 -
668  lib/extension.c                        |    8 -
669  lib/getifaddrs.c                       |  271 +++
670  lib/getifaddrs.h                       |   76 +
671  lib/handshake.c                        |  582 +----
672  lib/libwebsockets.c                    | 2493 ++++++---------------
673  lib/libwebsockets.h                    |  115 +-
674  lib/md5.c                              |  217 --
675  lib/minilex.c                          |  440 ++++
676  lib/output.c                           |  628 ++++++
677  lib/parsers.c                          | 2016 +++++------------
678  lib/private-libwebsockets.h            |  284 +--
679  lib/server-handshake.c                 |  275 +++
680  lib/server.c                           |  377 ++++
681  libwebsockets-api-doc.html             |  300 +--
682  m4/ignore-me                           |    2 +
683  test-server/Makefile.am                |  111 +-
684  test-server/libwebsockets.org-logo.png |  Bin 0 -> 7029 bytes
685  test-server/test-client.c              |   45 +-
686  test-server/test-echo.c                |  330 +++
687  test-server/test-fraggle.c             |   20 +-
688  test-server/test-ping.c                |   22 +-
689  test-server/test-server-extpoll.c      |  554 -----
690  test-server/test-server.c              |  349 ++-
691  test-server/test.html                  |    3 +-
692  win32port/zlib/ZLib.vcxproj            |  749 ++++---
693  win32port/zlib/ZLib.vcxproj.filters    |  188 +-
694  win32port/zlib/adler32.c               |  348 ++-
695  win32port/zlib/compress.c              |  160 +-
696  win32port/zlib/crc32.c                 |  867 ++++----
697  win32port/zlib/crc32.h                 |  882 ++++----
698  win32port/zlib/deflate.c               | 3799 +++++++++++++++-----------------
699  win32port/zlib/deflate.h               |  688 +++---
700  win32port/zlib/gzclose.c               |   50 +-
701  win32port/zlib/gzguts.h                |  325 ++-
702  win32port/zlib/gzlib.c                 | 1157 +++++-----
703  win32port/zlib/gzread.c                | 1242 ++++++-----
704  win32port/zlib/gzwrite.c               | 1096 +++++----
705  win32port/zlib/infback.c               | 1272 ++++++-----
706  win32port/zlib/inffast.c               |  680 +++---
707  win32port/zlib/inffast.h               |   22 +-
708  win32port/zlib/inffixed.h              |  188 +-
709  win32port/zlib/inflate.c               | 2976 +++++++++++++------------
710  win32port/zlib/inflate.h               |  244 +-
711  win32port/zlib/inftrees.c              |  636 +++---
712  win32port/zlib/inftrees.h              |  124 +-
713  win32port/zlib/trees.c                 | 2468 +++++++++++----------
714  win32port/zlib/trees.h                 |  256 +--
715  win32port/zlib/uncompr.c               |  118 +-
716  win32port/zlib/zconf.h                 |  934 ++++----
717  win32port/zlib/zlib.h                  | 3357 ++++++++++++++--------------
718  win32port/zlib/zutil.c                 |  642 +++---
719  win32port/zlib/zutil.h                 |  526 ++---
720  69 files changed, 19556 insertions(+), 20145 deletions(-)
721
722 user api changes
723 ----------------
724
725  - libwebsockets_serve_http_file() now takes a context as first argument
726
727  - libwebsockets_get_peer_addresses() now takes a context and wsi as first
728         two arguments
729
730
731 user api additions
732 ------------------
733
734  - lwsl_...() logging apis, default to stderr but retargetable by user code;
735         may be used also by user code
736
737  - lws_set_log_level() set which logging apis are able to emit (defaults to
738         notice, warn, err severities), optionally set the emit callback
739
740  - lwsl_emit_syslog() helper callback emits to syslog
741
742  - lws_daemonize() helper code that forks the app into a headless daemon
743         properly, maintains a lock file with pid in suitable for sysvinit etc to
744         control lifecycle
745
746  - LWS_CALLBACK_HTTP_FILE_COMPLETION callback added since http file
747         transfer is now asynchronous (see test server code)
748
749  - lws_frame_is_binary() from a wsi pointer, let you know if the received
750         data was sent in BINARY mode
751
752
753 user api removals
754 -----------------
755
756  - libwebsockets_fork_service_loop() - no longer supported (had intractable problems)
757         arrange your code to act from the user callback instead from same
758         process context as the service loop
759
760  - libwebsockets_broadcast() - use libwebsocket_callback_on_writable[_all_protocol]()
761         instead from same process context as the service loop.  See the test apps
762         for examples.
763
764  - x-google-mux() removed until someone wants it
765
766  - pre -v13 (ancient) protocol support removed
767
768
769 New features
770 ------------
771
772  - echo test server and client compatible with echo.websocket.org added
773
774  - many new configure options (see README.build) to reduce footprint of the
775         library to what you actually need, eg, --without-client and
776         --without-server
777
778  - http + websocket server can build to as little as 12K .text for ARM
779
780  - no more MAX_CLIENTS limitation; adapts to support the max number of fds
781         allowed to the process by ulimit, defaults to 1024 on Fedora and
782         Ubuntu.  Use ulimit to control this without needing to configure
783         the library.  Code here is smaller and faster.
784
785  - adaptive ratio of listen socket to connection socket service allows
786         good behaviour under Apache ab test load.  Tested with thousands
787         of simultaneous connections
788
789  - reduction in per-connection memory footprint by moving to a union to hold
790         mutually-exclusive state for the connection
791
792  - robustness: Out of Memory taken care of for all allocation code now
793
794  - internal getifaddrs option if your toolchain lacks it (some uclibc)
795
796  - configurable memory limit for deflate operations
797
798  - improvements in SSL code nonblocking operation, possible hang solved,
799         some SSL operations broken down into pollable states so there is
800         no library blocking, timeout coverage for SSL_connect
801
802  - extpoll test server merged into single test server source
803
804  - robustness: library should deal with all recoverable socket conditions
805
806  - rx flowcontrol for backpressure notification fixed and implmeneted
807         correctly in the test server
808
809  - optimal lexical parser added for header processing; all headers in a
810         single 276-byte state table
811
812  - latency tracking api added (configure --with-latency)
813
814  - Improved in-tree documentation, REAME.build, README.coding,
815         README.test-apps, changelog
816
817  - Many small fixes
818
819
820 v1.0-chrome25-firefox17 (6cd1ea9b005933f)