Commit graph

2143 commits

Author SHA1 Message Date
Denis Osvald
f107e4bb85 libuv: sigint API cleanup
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2016-03-23 07:46:39 +08:00
Denis Osvald
de9f794b27 libuv: handle signals only if requested
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2016-03-23 07:44:06 +08:00
Andy Green
1a13885afd cgi env
Improve cgi support so it's capable of running cgit
2016-03-21 15:17:33 +08:00
Andy Green
1e5a9ad2dc proxy rewrite
If you enable -DLWS_WITH_HTTP_PROXY=1 at cmake, the test server has a
new URI path http://localhost:7681/proxytest If you visit here, a client
connection to http://example.com:80 is spawned, and the results piped on
to your original connection.

Also with LWS_WITH_HTTP_PROXY enabled at cmake, lws wants to link to an
additional library, "libhubbub".  This allows lws to do html rewriting on the
fly, adjusting proxied urls in a lightweight and fast way.
2016-03-20 11:59:53 +08:00
Andy Green
5c8906e931 client chunked transfer encoding
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-19 17:21:45 +08:00
Andy Green
c3c2d6d953 cgi header processing
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-19 17:21:45 +08:00
Andy Green
8007cc6829 b64decode correct decode of some strings
https://github.com/warmcat/libwebsockets/issues/467

Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-19 07:43:22 +08:00
Andy Green
7bc87ab662 clean signed mismatches and protect ssl specific code
https://github.com/warmcat/libwebsockets/issues/466

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-18 23:55:59 +08:00
Alex Hultman
cea07d6f1f lws_write restrict chunk size 2016-03-18 15:02:27 +08:00
Andy Green
0f9904fedf ssl option for auto redir to https
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-17 15:27:18 +08:00
Alex Hultman
599cad9436 Optimize payload exhaustion
https://github.com/warmcat/libwebsockets/pull/462

AG refactor and do loop unrolling
2016-03-17 09:41:44 +08:00
Andy Green
e32c0ba29b appveyor update 1.0.2g
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-17 08:57:33 +08:00
Andy Green
5960158958 clang fixes 1
https://github.com/warmcat/libwebsockets/issues/461

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-15 21:49:32 +08:00
bjqiwei
04935e28b0 client perform WSI_CREATE callback 2016-03-15 16:24:58 +08:00
Andy Green
c793944f17 socket interface bind generalize to lws_socket_bind
Move the socket bind to interface code out of server into
libwebsockets.c and make a private api for it.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-13 08:50:55 +08:00
Joakim Soderberg
9a720bbb50 ssl ecdh adapt if missing ecdh.h include
https://github.com/warmcat/libwebsockets/issues/457
2016-03-12 08:48:41 +08:00
Andy Green
4f5ebec3ef client ext hdr skip if no arg
https://github.com/warmcat/libwebsockets/issues/453#event-583227314

abnf does say has to be at least one arg

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-09 23:13:31 +08:00
Andy Green
43befcba91 release checklist specfile install soname
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-09 10:51:06 +08:00
Andy Green
4a1c6297e8 rpm specfile so install list bump
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-09 10:50:25 +08:00
Andy Green
f66a12abb2 libev set foreign loop properly
After gaby64

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-09 07:44:49 +08:00
Andy Green
7d22c29722 windows deal with no snprintf
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-04 10:53:51 +08:00
Andy Green
fb5f33bb2f test server http proxy
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-02 18:57:41 +08:00
Andy Green
494418abac add explicit parent child wsi relationships
wsi can have a full tree relationship with each other using
linked lists.  closing the parent ensures the children are
closed first.

Convert cgi to use this instead of his cgi-specific sub-wsi
management.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-02 18:57:41 +08:00
Alex Hultman
fe16003644 libuv.c: Service fd with LWS_POLLHUP on poll errors 2016-03-02 18:57:26 +08:00
Ondraco
442ae80b87 wince minor adaptations
https://github.com/warmcat/libwebsockets/issues/444
2016-03-01 07:50:18 +08:00
Daniel Santos
f3d1d41bdd satisfy apparently bogus compiler warning somewhere 2016-03-01 07:50:17 +08:00
Andy Green
a661ee5d53 client support http without ws
Server support for http[s] as well as ws[s] is implicit.
But until now client only supported ws[s].

This allows the user code to pass an explicit http method
like "GET" in the connect_info, disabling the ws upgrade logic.

Then you can also use lws client as http client, not just ws.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 18:41:36 +08:00
Andy Green
2d8d35a1be client accept connection request even if no free ah
It can join the free ah list and pick up client connect processing
later when the ah becomes available; this simplifies the code
doing the request since he won't have to deal with unexpected
failures / retries based on dynamic ah availability.

To do this though we have to handle that the connect_info members
may not have scope that lets them still exist after we return from
the first connect call, we stash them in a malloc'd buffer so the
connect processing can have them much later even so.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 14:19:16 +08:00
Andy Green
f859e2d3ed release checklist ab
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 11:26:13 +08:00
Andy Green
e3d141dae9 adopt readbuf do service
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 11:04:53 +08:00
Andy Green
ee699c0036 libuv when in use skip shutdown close phase
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 10:34:58 +08:00
Andy Green
442e1c850d 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:34:58 +08:00
Andy Green
83af28a747 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-29 10:34:58 +08:00
Andy Green
03384721e7 test server libuv support status protocol
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-27 13:17:26 +08:00
Andy Green
38a1cbb498 libuv create 1Hz background timeout check
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-27 11:04:04 +08:00
Kamil Rytarowski
f57a2b5a8c Don't include <sys/cdefs.h> for NetBSD
We needed it for the BSD symbol to be defined, while __NetBSD__ is defined
with a compiler.

Thanks Andy Green for the initial fix.

Signed-off-by: Kamil Rytarowski <n54@gmx.com>
2016-02-27 10:30:59 +08:00
Andy Green
c0495892bc netbsd netinet include
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-27 09:34:28 +08:00
Andy Green
1bcc110299 force service properly when unconsumed rxbuf in ah
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-26 10:48:51 +08:00
Andy Green
58cc41bc1c adopt readbuf fix no ah path
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-26 09:22:29 +08:00
Andy Green
4ba798dd7d close wsi must do detatch ah flow even if no ah
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 21:50:49 +08:00
Andy Green
897197146a improve timeout and ah list comments
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 21:43:29 +08:00
Andy Green
73321ccfb0 remove ah scan
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 21:43:09 +08:00
Andy Green
d8267a43b8 fix missing callback return check
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 20:27:10 +08:00
Andy Green
0a9bd7e971 unix privs change group before user
Otherwise we no longer have privs to change the group after doing the user

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 15:12:16 +08:00
Andy Green
a11018089f test server log LWS_CALLBACK_HTTP
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 15:06:37 +08:00
Andy Green
d61bed3ce6 logging timestamp creation expose as api
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 15:01:55 +08:00
Andy Green
6a8099b071 cgi
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:45:17 +08:00
Andy Green
dbfbbb41b1 user code must explicitly complete http transaction
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:45:17 +08:00
Andy Green
5c0bcf49a8 defeat POLLOUT if socket in shutdown wait
After andrejs.hanins@ubnt.com

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:45:17 +08:00
Andy Green
51d9afadd6 adopt variant with preamble rx
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:45:17 +08:00