Commit graph

98 commits

Author SHA1 Message Date
Andy Green
a085a0ab38 v1.7.9
SONAME to 7.1 because of lws_snprintf()
2016-09-15 02:43:37 +08:00
Andy Green
6d19521b90 v1.7.8
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-12 22:15:15 +08:00
Andy Green
29458b105d v1.7.7
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-03 14:29:07 +08:00
Andy Green
449e73433c v1.7.6
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-23 10:09:33 +08:00
Andy Green
e3e89a7241 v1.7.5
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-01 09:45:57 +08:00
Andy Green
18c328a631 v1.7.4
Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-22 09:19:32 +08:00
Andy Green
f192c01a13 client ext hdr skip if no arg
https://github.com/warmcat/libwebsockets/issues/453

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-09 23:35:41 +08:00
Andy Green
7c8ef84848 v1.7.3
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 11:30:07 +08:00
Andy Green
ea3cf82769 windows listen for pollhup
After Ondraco

https://github.com/warmcat/libwebsockets/issues/441

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 10:09:15 +08:00
Andy Green
360c0a8ee4 ah move more_rx_waiting to wsi scope
Originally this was alright in wsi->u.hdr, because ah implied header
processing.  But since we allowed ah to be held across http
keep-alive transactions if we saw we had more header data, it means
we were trying to read this union member out of scope after it had
transitioned.

Moving the more_rx_waiting member to be a 1-bit bifield in the wsi
solves it and lets us check the state any time later at http
transaction completion.

https://github.com/warmcat/libwebsockets/issues/441

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-28 11:02:42 +08:00
Andy Green
00aaa3aa12 close wsi must do detatch ah flow even if no ah
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 21:55:06 +08:00
Andy Green
34266b7861 v1.7.2
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 10:11:01 +08:00
Andy Green
ee2f1ea667 defeat POLLOUT if socket in shutdown wait
After andrejs.hanins@ubnt.com

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-24 21:32:31 +08:00
Andy Green
4038721baf test server add lws_status
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 13:44:07 +08:00
Alex Hultman
a3a0792012 Make sure every handle is closed before destroying the uv loop 2016-02-20 22:50:53 +08:00
Andy Green
daf7ca4fa9 changelog sync
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-20 09:20:36 +08:00
Andy Green
1b78f7946f more documentation typos
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-17 07:47:42 +08:00
Andy Green
9c60ed9d07 v1.7.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-16 13:20:46 +08:00
Andy Green
200a6a296e timeout settable from info
This adds an info member that allows the user code to
set the library's network action timeout in seconds.

If left at the default 0, the build-time default
AWAITING_TIMEOUT continues to be used.

As suggested

https://github.com/warmcat/libwebsockets/issues/427

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 20:39:07 +08:00
Andy Green
86ed65ff00 libuv integration
This gets the libuv stuff plumbed in and working.

Currently it's only workable for some service thread, and there
is an isolated valgrind problem left

==28425== 128 bytes in 1 blocks are definitely lost in loss record 3 of 3
==28425==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28425==    by 0x4C2AB1E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28425==    by 0x58BBB27: maybe_resize (core.c:748)
==28425==    by 0x58BBB27: uv__io_start (core.c:787)
==28425==    by 0x58C1B80: uv__signal_loop_once_init (signal.c:225)
==28425==    by 0x58C1B80: uv_signal_init (signal.c:260)
==28425==    by 0x58BF7A6: uv_loop_init (loop.c:66)
==28425==    by 0x4157F5: lws_uv_initloop (libuv.c:89)
==28425==    by 0x405536: main (test-server-libuv.c:284)

libuv wants to sign off on all libuv 'handles' that will close, and
callback to do the close confirmation asynchronously.  The wsi close function
is adapted when libuv is in use to work with libuv accordingly and exit the uv
loop the number of remaining wsi is zero.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-14 09:31:13 +08:00
f9267170a3 fixed LWS_PRE description 2016-02-09 15:52:32 +08:00
Danomi Czaski
4e9c7f3504 lextable add x-real-ip
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-28 09:40:53 +08:00
Andy Green
ba119e9057 lws_adopt_socket
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-26 21:40:32 +08:00
Andy Green
d3a5505542 multithreaded service
This adds support for multithreaded service to lws without adding any
threading or locking code in the library.

At context creation time you can request split the service part of the
context into n service domains, which are load-balanced so that the most
idle one gets the next listen socket accept.

There's a single listen socket on one port still.

User code may then spawn n threads doing n service loops / poll()s
simultaneously.  Locking is only required (I think) in the existing
FD lock callbacks already handled by the pthreads server example,
and that locking takes place in user code.  So the library remains
completely agnostic about the threading / locking scheme.

And by default, it's completely compatible with one service thread
so no changes are required by people uninterested in multithreaded
service.

However for people interested in extremely lightweight mass http[s]/
ws[s] service with minimum provisioning, the library can now do
everything out of the box.

To test it, just try

$ libwebsockets-test-server-pthreads -j 8

where -j controls the number of service threads

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-19 20:02:36 +08:00
Andy Green
809d69aa85 redirect
This adds redirect support to the client side.  Lws will follow
server redirects (301) up to three deep.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-15 19:32:47 +08:00
Vijay Khurdiya
e73d446461 ssl add ECDH server support
(AG clean style add option flag and docs)
2016-01-15 16:21:51 +08:00
Andy Green
6711266a50 extension permessage deflate
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-11 11:34:01 +08:00
Andy Green
44a7f65e1a introduce LWS_SERVER_OPTION_VALIDATE_UTF8
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-29 11:20:09 +08:00
Andy Green
4e2ac7685d clarify changelog
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 20:26:11 +08:00
Andy Green
1fb95e8084 close add api to control sent close frame contents
This adds an api lws_close_reason() which lets you control what will
be sent in the close frame when the connection is closed by returning
nonzero from the user callback.

The test server demo is extended to prove it works in both directions.

With this, we should have nice close support.

https://github.com/warmcat/libwebsockets/issues/196

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 17:20:34 +08:00
Andy Green
066a7a1801 close add callback to get peer close reason
https://github.com/warmcat/libwebsockets/issues/196

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 15:47:06 +08:00
Andy Green
5b85e39d99 mbed3 remove unused allocations
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 13:23:11 +08:00
Andy Green
3246ebb3f5 deprecate LWS_SEND_BUFFER_POST_PADDING
The only guy who cared about this for a long while
(since I eliminated the pre-standard protocol variants)
was sending a close frame.

 - Set it to 0 so old code remains happy.  It only affects
user code buffer commit, if there's overcommit no harm
done so no effect directly on user ABI.

 - Remove all uses inside the library.  The sample apps
don't have it any more and that's the recommendation now.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 12:03:06 +08:00
Andy Green
3df580066b http header malloc pool implement pool
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-25 14:34:20 +08:00
Andy Green
9e8d148912 changelog pre v1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 11:01:03 +08:00
Andy Green
6d64539fcb lws_get_context not _ctx
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-17 18:25:25 +08:00
Andy Green
00c6d1579c public api remove context from user callback API BREAK
Since struct lws (wsi) now has his own context pointer,
we were able to remove the need for passing context
almost everywhere in the apis.

In turn, that means there's no real use for context being
passed to every callback; in the rare cases context is
needed user code can get it with lws_get_ctx(wsi)

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-17 07:54:44 +08:00
Andy Green
11c05bfa09 public api remove superfluous context params API BREAK
Extend the cleanout caused by wsi having a context pointer
into the public api.

There's no point keeping the 1.5 compatibility work,
we have changed the api in several places and
rebuilt wasn't going to be enough a while ago.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-16 18:19:08 +08:00
Andy Green
3f59996e67 changelog update file api about wsi
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-14 07:21:42 +08:00
Andy Green
3f62870e67 introduce lws_wsi_user
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-14 07:16:32 +08:00
Andy Green
1a366bf946 changelog explain protocols related api changes
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-14 07:02:51 +08:00
Andy Green
4e442b7743 lws_plat_fd implement platform default handlers
This is a rewrite of the patch from Soapyman here

https://github.com/warmcat/libwebsockets/pull/363

The main changes compared to Soapyman's original patch are

 - There's no new stuff in the info struct user code does any overrides
   it may want to do explicitly after lws_context_create returns

 - User overrides for file ops can call through (subclass) to the original
   platform implementation using lws_get_fops_plat()

 - A typedef is provided for plat-specific fd type

 - Public helpers are provided to allow user code to be platform-independent
   about file access, using the lws platform file operations underneath:

static inline lws_filefd_type
lws_plat_file_open(struct lws_plat_file_ops *fops, const char *filename,
		   unsigned long *filelen, int flags)

static inline int
lws_plat_file_close(struct lws_plat_file_ops *fops, lws_filefd_type fd)

static inline unsigned long
lws_plat_file_seek_cur(struct lws_plat_file_ops *fops, lws_filefd_type fd,
		       long offset_from_cur_pos)

static inline int
lws_plat_file_read(struct lws_plat_file_ops *fops, lws_filefd_type fd,
		   unsigned long *amount, unsigned char *buf, unsigned long len)

static inline int
lws_plat_file_write(struct lws_plat_file_ops *fops, lws_filefd_type fd,
		    unsigned long *amount, unsigned char *buf, unsigned long len)

There's example documentation and implementation in the test server.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 11:01:59 +08:00
Andy Green
6d41720233 api rationalization add cmake switch to export old api wrappers
This is off by default, use

 -D LWS_WITH_OLD_API_WRAPPERS=1

on cmake to get the old api names exported from the library as wrappers
around the new api names.

This allows the library to continue to be compatible with apps that are
not rebuilt with the new libwebsockets.h api compatibility defines.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 10:39:23 +08:00
Peter Pentchev
bb085dab04 Fix some minor typos. 2015-12-03 22:32:59 +08:00
Andy Green
ab620ffde3 release v1.5
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-28 08:39:09 +08:00
Andy Green
4c79ee7598 LWS_WITHOUT_BUILTIN_SHA1
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 11:20:40 +08:00
Andy Green
6d59f59745 LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED
Requested by Bruce Perens

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-June/001834.html

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 09:12:58 +08:00
MGadkari
020c53c8cc Pass HTTP reject error code returned by server to client
AG: added changelog and documentation comment

Signed-off-by: Gadkari Mugdha <mugdha.gadkari@siemens.com>
Reviewed-by: Roger Meier <r.meier@siemens.com>

HTTP reject error code returned by server during HTTP handshake is extracted and sent to the client application.
With this fix, the Connection error callback will include the HTTP reject status code and response frame received from server. This string passed in Connection error callback can be read or ignored by client application based on client application requirement
2015-10-12 07:51:34 +08:00
Andy Green
16fb0132ce prepare for v1.4
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-03-28 11:35:40 +08:00
joseph.urciuoli
4d9c8fc01a ssl allow externally managed SSL_CTX
Signed-off-by: joseph.urciuoli <trac90@UNKNOWN.org>
2014-10-16 08:53:19 +08:00