changelog 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. Changelog
  2. ---------
  3. v2.2.0
  4. ======
  5. Major new features
  6. - A mount can be protected by Basic Auth... in lwsws it looks like this
  7. ```
  8. {
  9. "mountpoint": "/basic-auth",
  10. "origin": "file://_lws_ddir_/libwebsockets-test-server/private",
  11. "basic-auth": "/var/www/balogins-private"
  12. }
  13. ```
  14. The text file named in `basic-auth` contains user:password information
  15. one per line.
  16. See README.lwsws.md for more information.
  17. - RFC7233 RANGES support in lws server... both single and multipart.
  18. This allows seeking for multimedia file serving and download resume.
  19. It's enabled by default but can be disabled by CMake option.
  20. - On Linux, lwsws can reload configuration without dropping ongoing
  21. connections, when sent a SIGHUP. The old configuration drops its
  22. listen sockets so the new configuration can listen on them.
  23. New connections connect to the server instance with the new
  24. configuration. When all old connections eventually close, the old
  25. instance automatically exits. This is equivalent to
  26. `systemctl reload apache`
  27. - New `adopt` api allow adoption including SSL negotiation and
  28. for raw sockets and file descriptors.
  29. - Chunked transfer encoding supported for client and server
  30. - Adaptations to allow operations inside OPTEE Secure World
  31. - ESP32 initial port - able to do all test server functions. See
  32. README.build.md
  33. - Serving gzipped files from inside a ZIP file is supported... this
  34. includes directly serving the gzipped content if the client
  35. indicated it could accept it (ie, almost all browsers) saving
  36. bandwidth and time. For clients that can't accept it, lws
  37. automatically decompresses and serves the content in memory-
  38. efficient chunks. Only a few hundred bytes of heap are needed
  39. to serve any size file from inside the zip. See README.coding.md
  40. - RAW file descriptors may now be adopted into the lws event loop,
  41. independent of event backend (including poll service).
  42. See README.coding.md
  43. - RAW server socket descriptors may now be enabled on the vhost if
  44. the first thing sent on the connection is not a valid http method.
  45. The user code can associate these with a specific protocol per
  46. vhost, and RAW-specific callbacks appear there for creation, rx,
  47. writable and close. See libwebsockets-test-server-v2.0 for an example.
  48. See README.coding.md
  49. - RAW client connections are now possible using the method "RAW".
  50. After connection, the socket is associated to the protocol
  51. named in the client connection info and RAW-specific callbacks
  52. appear there for creation, rx, writable and close.
  53. See libwebsockets-test-client (with raw://) for an example.
  54. See README.coding.md
  55. v2.1.0
  56. ======
  57. Major new features
  58. - Support POST arguments, including multipart and file attachment
  59. - Move most of lwsws into lws, make the stub CC0
  60. - Add loopback test plugin to confirm client ws / http coexistence
  61. - Integrate lwsws testing on Appveyor (ie, windows)
  62. - Introduce helpers for sql, urlencode and urldecode sanitation
  63. - Introduce LWS_CALLBACK_HTTP_BIND_PROTOCOL / DROP_PROTOCOL that
  64. are compatible with http:/1.1 pipelining and different plugins
  65. owning different parts of the URL space
  66. - lwsgs - Generic Sessions plugin supports serverside sessions,
  67. cookies, hashed logins, forgot password etc
  68. - Added APIs for sending email to SMTP servers
  69. - Messageboard example plugin for lwsgs
  70. - Automatic PING sending at fixed intervals and close if no response
  71. - Change default header limit in ah to 4096 (from 1024)
  72. - Add SNI matching for wildcards if no specific wildcard vhost name match
  73. - Convert docs to Doxygen
  74. - ESP8266 support ^^
  75. Fixes
  76. -----
  77. See git log v2.0.0..
  78. v2.0.0
  79. ======
  80. Summary
  81. -------
  82. - There are only api additions, the api is compatible with v1.7.x. But
  83. there is necessarily an soname bump to 8.
  84. - If you are using lws client, you mainly need to be aware the option
  85. LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT is needed at context-creation time
  86. if you will use SSL.
  87. - If you are using lws for serving, the above is also true but there are
  88. many new features to simplify your code (and life). There is a
  89. summany online here
  90. https://libwebsockets.org/lws-2.0-new-features.html
  91. but basically the keywords are vhosts, mounts and plugins. You can now
  92. do the web serving part from lws without any user callback code at all.
  93. See ./test-server/test-server-v2.0.c for an example, it has no user
  94. code for ws either since it uses the protocol plugins... that one C file
  95. is all that is needed to do the whole test server function.
  96. You now have the option to use a small generic ws-capable webserver
  97. "lwsws" and write your ws part as a plugin. That eliminates even
  98. cut-and-pasting the test server code and offers more configurable
  99. features like control over http cacheability in JSON.
  100. Fixes
  101. -----
  102. These are already in 1.7.x series
  103. 1) MAJOR (Windows-only) fix assert firing
  104. 2) MAJOR http:/1.1 connections handled by lws_return_http_status() did not
  105. get sent a content-length resulting in the link hanging until the peer closed
  106. it. attack.sh updated to add a test for this.
  107. 3) MINOR An error about hdr struct in _lws_ws_related is corrected, it's not
  108. known to affect anything until after it was fixed
  109. 4) MINOR During the close shutdown wait state introduced at v1.7, if something
  110. requests callback on writeable for the socket it will busywait until the
  111. socket closes
  112. 5) MAJOR Although the test server has done it for a few versions already, it
  113. is now required for the user code to explicitly call
  114. if (lws_http_transaction_completed(wsi))
  115. return -1;
  116. when it finishes replying to a transaction in http. Previously the library
  117. did it for you, but that disallowed large, long transfers with multiple
  118. trips around the event loop (and cgi...).
  119. 6) MAJOR connections on ah waiting list that closed did not get removed from
  120. the waiting list...
  121. 7) MAJOR since we added the ability to hold an ah across http keepalive
  122. transactions where more headers had already arrived, we broke the ability
  123. to tell if more headers had arrived. Result was if the browser didn't
  124. close the keepalive, we retained ah for the lifetime of the keepalive,
  125. using up the pool.
  126. 8) MAJOR windows-only-POLLHUP was not coming
  127. 9) Client should not send ext hdr if no exts
  128. Changes
  129. -------
  130. 1) MINOR test-server gained some new switches
  131. -C <file> use external SSL cert file
  132. -K <file> use external SSL key file
  133. -A <file> use external SSL CA cert file
  134. -u <uid> set effective uid
  135. -g <gid> set effective gid
  136. together you can use them like this to have the test-server work with the
  137. usual purchased SSL certs from an official CA.
  138. --ssl -C your.crt -K your.key -A your.cer -u 99 -g 99
  139. 2) MINOR the OpenSSL magic to setup ECDH cipher usage is implemented in the
  140. library, and the ciphers restricted to use ECDH only.
  141. Using this, the lws test server can score an A at SSLLABS test
  142. 3) MINOR STS (SSL always) header is added to the test server if you use --ssl. With
  143. that, we score A+ at SSLLABS test
  144. 4) MINOR daemonize function (disabled at cmake by default) is updated to work
  145. with systemd
  146. 5) MINOR example systemd .service file now provided for test server
  147. (not installed by default)
  148. 6) test server html is updated with tabs and a new live server monitoring
  149. feature. Input sanitization added to the js.
  150. 7) client connections attempted when no ah is free no longer fail, they are
  151. just deferred until an ah becomes available.
  152. 8) The test client pays attention to if you give it an http:/ or https://
  153. protocol string to its argument in URL format. If so, it stays in http[s]
  154. client mode and doesn't upgrade to ws[s], allowing you to do generic http client
  155. operations. Receiving transfer-encoding: chunked is supported.
  156. 9) If you enable -DLWS_WITH_HTTP_PROXY=1 at cmake, the test server has a
  157. new URI path http://localhost:7681/proxytest If you visit here, a client
  158. connection to http://example.com:80 is spawned, and the results piped on
  159. to your original connection.
  160. 10) Also with LWS_WITH_HTTP_PROXY enabled at cmake, lws wants to link to an
  161. additional library, "libhubbub". This allows lws to do html rewriting on the
  162. fly, adjusting proxied urls in a lightweight and fast way.
  163. 11) There's a new context creation flag LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT,
  164. this is included automatically if you give any other SSL-related option flag.
  165. If you give no SSL-related option flag, nor this one directly, then even
  166. though SSL support may be compiled in, it is never initialized nor used for the
  167. whole lifetime of the lws context.
  168. Conversely in order to prepare the context to use SSL, even though, eg, you
  169. are not listening on SSL but will use SSL client connections later, you must
  170. give this flag explicitly to make sure SSL is initialized.
  171. User API additions
  172. ------------------
  173. 1) MINOR APIBREAK There's a new member in struct lws_context_creation_info, ecdh_curve,
  174. which lets you set the name of the ECDH curve OpenSSL should use. By
  175. default (if you leave ecdh_curve NULL) it will use "prime256v1"
  176. 2) MINOR NEWAPI It was already possible to adopt a foreign socket that had not
  177. been read from using lws_adopt_socket() since v1.7. Now you can adopt a
  178. partially-used socket if you don't need SSL, by passing it what you read
  179. so it can drain that before reading from the socket.
  180. LWS_VISIBLE LWS_EXTERN struct lws *
  181. lws_adopt_socket_readbuf(struct lws_context *context, lws_sockfd_type accept_fd,
  182. const char *readbuf, size_t len);
  183. 3) MINOR NEWAPI CGI type "network io" subprocess execution is now possible from
  184. a simple api.
  185. LWS_VISIBLE LWS_EXTERN int
  186. lws_cgi(struct lws *wsi, char * const *exec_array, int script_uri_path_len,
  187. int timeout_secs);
  188. LWS_VISIBLE LWS_EXTERN int
  189. lws_cgi_kill(struct lws *wsi);
  190. To use it, you must first set the cmake option
  191. $ cmake .. -DLWS_WITH_CGI=1
  192. See test-server-http.c and test server path
  193. http://localhost:7681/cgitest
  194. stdin gets http body, you can test it with wget
  195. $ echo hello > hello.txt
  196. $ wget http://localhost:7681/cgitest --post-file=hello.txt -O- --quiet
  197. lwstest script
  198. read="hello"
  199. The test script returns text/html table showing /proc/meminfo. But the cgi
  200. support is complete enough to run cgit cgi.
  201. 4) There is a helper api for forming logging timestamps
  202. LWS_VISIBLE int
  203. lwsl_timestamp(int level, char *p, int len)
  204. this generates this kind of timestamp for use as logging preamble
  205. lwsts[13116]: [2016/01/25 14:52:52:8386] NOTICE: Initial logging level 7
  206. 5) struct lws_client_connect_info has a new member
  207. const char *method
  208. If it's NULL, then everything happens as before, lws_client_connect_via_info()
  209. makes a ws or wss connection to the address given.
  210. If you set method to a valid http method like "GET", though, then this method
  211. is used and the connection remains in http[s], it's not upgraded to ws[s].
  212. So with this, you can perform http[s] client operations as well as ws[s] ones.
  213. There are 4 new related callbacks
  214. LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP = 44,
  215. LWS_CALLBACK_CLOSED_CLIENT_HTTP = 45,
  216. LWS_CALLBACK_RECEIVE_CLIENT_HTTP = 46,
  217. LWS_CALLBACK_COMPLETED_CLIENT_HTTP = 47,
  218. 6) struct lws_client_connect_info has a new member
  219. const char *parent_wsi
  220. if non-NULL, the client wsi is set to be a child of parent_wsi. This ensures
  221. if parent_wsi closes, then the client child is closed just before.
  222. 7) If you're using SSL, there's a new context creation-time option flag
  223. LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS. If you give this, non-ssl
  224. connections to the server listen port are accepted and receive a 301
  225. redirect to / on the same host and port using https://
  226. 8) User code may set per-connection extension options now, using a new api
  227. "lws_set_extension_option()".
  228. This should be called from the ESTABLISHED callback like this
  229. lws_set_extension_option(wsi, "permessage-deflate",
  230. "rx_buf_size", "12"); /* 1 << 12 */
  231. If the extension is not active (missing or not negotiated for the
  232. connection, or extensions are disabled on the library) the call is
  233. just returns -1. Otherwise the connection's extension has its
  234. named option changed.
  235. The extension may decide to alter or disallow the change, in the
  236. example above permessage-deflate restricts the size of his rx
  237. output buffer also considering the protocol's rx_buf_size member.
  238. New application lwsws
  239. ---------------------
  240. A libwebsockets-based general webserver is built by default now, lwsws.
  241. It's configured by JSON, by default in
  242. /etc/lwsws/conf
  243. which contains global lws context settings like this
  244. {
  245. "global": {
  246. "uid": "99",
  247. "gid": "99",
  248. "interface": "eth0",
  249. "count-threads": "1"
  250. }
  251. }
  252. /etc/lwsws/conf.d/*
  253. which contains zero or more files describing vhosts, like this
  254. {
  255. "vhosts": [
  256. { "name": "warmcat.com",
  257. "port": "443",
  258. "host-ssl-key": "/etc/pki/tls/private/warmcat.com.key",
  259. "host-ssl-cert": "/etc/pki/tls/certs/warmcat.com.crt",
  260. "host-ssl-ca": "/etc/pki/tls/certs/warmcat.com.cer",
  261. "mounts": [
  262. { "/": [
  263. { "home": "file:///var/www/warmcat.com" },
  264. { "default": "index.html" }
  265. ]
  266. }
  267. ]
  268. }
  269. ]
  270. }
  271. v1.7.0
  272. ======
  273. Extension Changes
  274. -----------------
  275. 1) There is now a "permessage-deflate" / RFC7692 implementation. It's very
  276. similar to "deflate-frame" we have offered for a long while; deflate-frame is
  277. now provided as an alias of permessage-deflate.
  278. The main differences are that the new permessage-deflate implementation:
  279. - properly performs streaming respecting input and output buffer limits. The
  280. old deflate-frame implementation could only work on complete deflate input
  281. and produce complete inflate output for each frame. The new implementation
  282. only mallocs buffers at initialization.
  283. - goes around the event loop after each input package is processed allowing
  284. interleaved output processing. The RX flow control api can be used to
  285. force compressed input processing to match the rate of compressed output
  286. processing (test--echo shows an example of how to do this).
  287. - when being "deflate-frame" for compatibility he uses the same default zlib
  288. settings as the old "deflate-frame", but instead of exponentially increasing
  289. malloc allocations until the whole output will fit, he observes the default
  290. input and output chunking buffer sizes of "permessage-deflate", that's
  291. 1024 in and 1024 out at a time.
  292. 2) deflate-stream has been disabled for many versions (for over a year) and is
  293. now removed. Browsers are now standardizing on "permessage-deflate" / RFC7692
  294. 3) struct lws_extension is simplified, and lws extensions now have a public
  295. api (their callback) for use in user code to compose extensions and options
  296. the user code wants. lws_get_internal_exts() is deprecated but kept around
  297. as a NOP. The changes allow one extension implementation to go by different
  298. names and allows the user client code to control option offers per-ext.
  299. The test client and server are updated to use the new way. If you use
  300. the old way it should still work, but extensions will be disabled until you
  301. update your code.
  302. Extensions are now responsible for allocating and per-instance private struct
  303. at instance construction time and freeing it when the instance is destroyed.
  304. Not needing to know the size means the extension's struct can be opaque
  305. to user code.
  306. User api additions
  307. ------------------
  308. 1) The info struct gained three new members
  309. - max_http_header_data: 0 for default (1024) or set the maximum amount of known
  310. http header payload that lws can deal with. Payload in unknown http
  311. headers is dropped silently. If for some reason you need to send huge
  312. cookies or other HTTP-level headers, you can now increase this at context-
  313. creation time.
  314. - max_http_header_pool: 0 for default (16) or set the maximum amount of http
  315. headers that can be tracked by lws in this context. For the server, if
  316. the header pool is completely in use then accepts on the listen socket
  317. are disabled until one becomes free. For the client, if you simultaneously
  318. have pending connects for more than this number of client connections,
  319. additional connects will fail until some of the pending connections timeout
  320. or complete.
  321. - timeout_secs: 0 for default (currently 20s), or set the library's
  322. network activity timeout to the given number of seconds
  323. HTTP header processing in lws only exists until just after the first main
  324. callback after the HTTP handshake... for ws connections that is ESTABLISHED and
  325. for HTTP connections the HTTP callback.
  326. So these settings are not related to the maximum number of simultaneous
  327. connections, but the number of HTTP handshakes that may be expected or ongoing,
  328. or have just completed, at one time. The reason it's useful is it changes the
  329. memory allocation for header processing to be one-time at context creation
  330. instead of every time there is a new connection, and gives you control over
  331. the peak allocation.
  332. Setting max_http_header_pool to 1 is fine it will just queue incoming
  333. connections before the accept as necessary, you can still have as many
  334. simultaneous post-header connections as you like. Since the http header
  335. processing is completed and the allocation released after ESTABLISHED or the
  336. HTTP callback, even with a pool of 1 many connections can be handled rapidly.
  337. 2) There is a new callback that allows the user code to get acccess to the
  338. optional close code + aux data that may have been sent by the peer.
  339. LWS_CALLBACK_WS_PEER_INITIATED_CLOSE:
  340. The peer has sent an unsolicited Close WS packet. @in and
  341. @len are the optional close code (first 2 bytes, network
  342. order) and the optional additional information which is not
  343. defined in the standard, and may be a string or non-human-
  344. readble data.
  345. If you return 0 lws will echo the close and then close the
  346. connection. If you return nonzero lws will just close the
  347. connection.
  348. As usual not handling it does the right thing, if you're not interested in it
  349. just ignore it.
  350. The test server has "open and close" testing buttons at the bottom, if you
  351. open and close that connection, on close it will send a close code 3000 decimal
  352. and the string "Bye!" as the aux data.
  353. The test server dumb-increment callback handles this callback reason and prints
  354. lwsts[15714]: LWS_CALLBACK_WS_PEER_INITIATED_CLOSE: len 6
  355. lwsts[15714]: 0: 0x0B
  356. lwsts[15714]: 1: 0xB8
  357. lwsts[15714]: 2: 0x42
  358. lwsts[15714]: 3: 0x79
  359. lwsts[15714]: 4: 0x65
  360. lwsts[15714]: 5: 0x21
  361. 3) There is a new API to allow the user code to control the content of the
  362. close frame sent when about to return nonzero from the user callback to
  363. indicate the connection should close.
  364. /**
  365. * lws_close_reason - Set reason and aux data to send with Close packet
  366. * If you are going to return nonzero from the callback
  367. * requesting the connection to close, you can optionally
  368. * call this to set the reason the peer will be told if
  369. * possible.
  370. *
  371. * @wsi: The websocket connection to set the close reason on
  372. * @status: A valid close status from websocket standard
  373. * @buf: NULL or buffer containing up to 124 bytes of auxiliary data
  374. * @len: Length of data in @buf to send
  375. */
  376. LWS_VISIBLE LWS_EXTERN void
  377. lws_close_reason(struct lws *wsi, enum lws_close_status status,
  378. unsigned char *buf, size_t len);
  379. An extra button is added to the "open and close" test server page that requests
  380. that the test server close the connection from his end.
  381. The test server code will do so by
  382. lws_close_reason(wsi, LWS_CLOSE_STATUS_GOINGAWAY,
  383. (unsigned char *)"seeya", 5);
  384. return -1;
  385. The browser shows the close code and reason he received
  386. websocket connection CLOSED, code: 1001, reason: seeya
  387. 4) There's a new context creation time option flag
  388. LWS_SERVER_OPTION_VALIDATE_UTF8
  389. if you set it in info->options, then TEXT and CLOSE frames will get checked to
  390. confirm that they contain valid UTF-8. If they don't, the connection will get
  391. closed by lws.
  392. 5) ECDH Certs are now supported. Enable the CMake option
  393. cmake .. -DLWS_SSL_SERVER_WITH_ECDH_CERT=1
  394. **and** the info->options flag
  395. LWS_SERVER_OPTION_SSL_ECDH
  396. to build in support and select it at runtime.
  397. 6) There's a new api lws_parse_uri() that simplifies chopping up
  398. https://xxx:yyy/zzz uris into parts nicely. The test client now uses this
  399. to allow proper uris as well as the old address style.
  400. 7) SMP support is integrated into LWS without any internal threading. It's
  401. very simple to use, libwebsockets-test-server-pthread shows how to do it,
  402. use -j <n> argument there to control the number of service threads up to 32.
  403. Two new members are added to the info struct
  404. unsigned int count_threads;
  405. unsigned int fd_limit_per_thread;
  406. leave them at the default 0 to get the normal singlethreaded service loop.
  407. Set count_threads to n to tell lws you will have n simultaneous service threads
  408. operating on the context.
  409. There is still a single listen socket on one port, no matter how many
  410. service threads.
  411. When a connection is made, it is accepted by the service thread with the least
  412. connections active to perform load balancing.
  413. The user code is responsible for spawning n threads running the service loop
  414. associated to a specific tsi (Thread Service Index, 0 .. n - 1). See
  415. the libwebsockets-test-server-pthread for how to do.
  416. If you leave fd_limit_per_thread at 0, then the process limit of fds is shared
  417. between the service threads; if you process was allowed 1024 fds overall then
  418. each thread is limited to 1024 / n.
  419. You can set fd_limit_per_thread to a nonzero number to control this manually, eg
  420. the overall supported fd limit is less than the process allowance.
  421. You can control the context basic data allocation for multithreading from Cmake
  422. using -DLWS_MAX_SMP=, if not given it's set to 32. The serv_buf allocation
  423. for the threads (currently 4096) is made at runtime only for active threads.
  424. Because lws will limit the requested number of actual threads supported
  425. according to LWS_MAX_SMP, there is an api lws_get_count_threads(context) to
  426. discover how many threads were actually allowed when the context was created.
  427. It's required to implement locking in the user code in the same way that
  428. libwebsockets-test-server-pthread does it, for the FD locking callbacks.
  429. If LWS_MAX_SMP=1, then there is no code related to pthreads compiled in the
  430. library. If more than 1, a small amount of pthread mutex code is built into
  431. the library.
  432. 8) New API
  433. LWS_VISIBLE struct lws *
  434. lws_adopt_socket(struct lws_context *context, lws_sockfd_type accept_fd)
  435. allows foreign sockets accepted by non-lws code to be adopted by lws as if they
  436. had just been accepted by lws' own listen socket.
  437. 9) X-Real-IP: header has been added as WSI_TOKEN_HTTP_X_REAL_IP
  438. 10) Libuv support is added, there are new related user apis
  439. typedef void (lws_uv_signal_cb_t)(uv_loop_t *l, uv_signal_t *w, int revents);
  440. LWS_VISIBLE LWS_EXTERN int
  441. lws_uv_sigint_cfg(struct lws_context *context, int use_uv_sigint,
  442. lws_uv_signal_cb_t *cb);
  443. LWS_VISIBLE LWS_EXTERN int
  444. lws_uv_initloop(struct lws_context *context, uv_loop_t *loop, int tsi);
  445. LWS_VISIBLE void
  446. lws_uv_sigint_cb(uv_loop_t *loop, uv_signal_t *watcher, int revents);
  447. and CMAKE option
  448. LWS_WITH_LIBUV
  449. User api changes
  450. ----------------
  451. 1) LWS_SEND_BUFFER_POST_PADDING is now 0 and deprecated. You can remove it; if
  452. you still use it, obviously it does nothing. Old binary code with nonzero
  453. LWS_SEND_BUFFER_POST_PADDING is perfectly compatible, the old code just
  454. allocated a buffer bigger than the library is going to use.
  455. The example apps no longer use LWS_SEND_BUFFER_POST_PADDING.
  456. The only path who made use of it was sending with LWS_WRITE_CLOSE --->
  457. 2) Because of lws_close_reason() formalizing handling close frames,
  458. LWS_WRITE_CLOSE is removed from libwebsockets.h. It was only of use to send
  459. close frames...close frame content should be managed using lws_close_reason()
  460. now.
  461. 3) We check for invalid CLOSE codes and complain about protocol violation in
  462. our close code. But it changes little since we were in the middle of closing
  463. anyway.
  464. 4) zero-length RX frames and zero length TX frames are now allowed.
  465. 5) Pings and close used to be limited to 124 bytes, the correct limit is 125
  466. so that is now also allowed.
  467. 6) LWS_PRE is provided as a synonym for LWS_SEND_BUFFER_PRE_PADDING, either is
  468. valid to use now.
  469. 7) There's generic support for RFC7462 style extension options built into the
  470. library now. As a consequence, a field "options" is added to lws_extension.
  471. It can be NULL if there are no options on the extension. Extension internal
  472. info is part of the public abi because extensions may be implemented outside
  473. the library.
  474. 8) WSI_TOKEN_PROXY enum was accidentally defined to collide with another token
  475. of value 73. That's now corrected and WSI_TOKEN_PROXY moved to his own place at
  476. 77.
  477. 9) With the addition of libuv support, libev is not the only event loop
  478. library in town and his api names must be elaborated with _ev_
  479. Callback typedef: lws_signal_cb ---> lws_ev_signal_cb_t
  480. lws_sigint_cfg --> lws_ev_sigint_cfg
  481. lws_initloop --> lws_ev_initloop
  482. lws_sigint_cb --> lws_ev_sigint_cb
  483. 10) Libev support is made compatible with multithreaded service,
  484. lws_ev_initloop (was lws_initloop) gets an extra argument for the
  485. thread service index (use 0 if you will just have 1 service thread).
  486. LWS_VISIBLE LWS_EXTERN int
  487. lws_ev_initloop(struct lws_context *context, ev_loop_t *loop, int tsi);
  488. (for earlier changelogs, see the tagged releases)