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