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