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