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