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