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