Commit graph

2143 commits

Author SHA1 Message Date
Andy Green
26d4249a3f ws union member must have actual struct at start not pointer
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:45:17 +08:00
Andrejs Hanins
9dbfe07798 client callback closed if not upgraded also for server connection
https://github.com/warmcat/libwebsockets/issues/437
https://github.com/warmcat/libwebsockets/pull/440
2016-02-25 09:45:17 +08:00
Andrejs Hanins
cc551fc0bf client connect must init position_in_fds_table 2016-02-25 09:45:17 +08:00
Andy Green
3ccac4d583 windows doesnt have localtime_r
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:43:59 +08:00
Andy Green
401d49aadc test server status no ssl include time header
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 09:43:59 +08:00
Andy Green
0ad1a6e5bf test server add lws_status
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 11:09:40 +08:00
Andy Green
d9da2c469f LWS_BUILD_HASH improve
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 11:09:40 +08:00
Andy Green
aa85024f9a test html add tabs
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 11:07:22 +08:00
Andy Green
ce0326b839 libwebsockets.org url updates
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 10:42:46 +08:00
Sebastian Reimer
57a1df4c88 lwsl stderr sink use formatted time
AG change to use localtime_r for threadsafety and leave old method as fallback
2016-02-21 07:42:49 +08:00
Andy Green
0a3d31b8a6 ssl get rid of build_cert_chain
It's not supported on major distro SSL (Fedora is 1.1) and
libressl (on 2.x) doesn't have it either.

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 07:08:28 +08:00
Alex Hultman
ecf7f00772 Stop uv loop in default signal handler, clean-ups 2016-02-20 23:06:56 +08:00
Alex Hultman
2904de5ff2 Make sure every handle is closed before destroying the uv loop 2016-02-20 22:48:34 +08:00
Alex Hultman
f84be14677 Don't destroy ev/uv loops if they haven't been created yet 2016-02-20 19:29:06 +08:00
Andy Green
0c3cc2efcb changelog sync
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-20 09:12:52 +08:00
Andy Green
d0249a82ec attack.sh add check for nonexistant file processing
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-20 08:12:31 +08:00
Andy Green
c6b0b607d4 lws_return_http_status send content length
If we're sending content, we must do so with a
content-length on http/1.1

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-20 07:53:24 +08:00
Andy Green
e34512e5e9 test server example systemd service file
Make sure you have daemonization enabled to use this

make .. -DLWS_WITHOUT_DAEMONIZE=0

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-19 12:46:36 +08:00
Andy Green
8582d47a00 daemonize work under systemd
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-19 12:44:59 +08:00
Andy Green
c1e6e38709 ah pool lifetime use dynamic rxpos
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-19 11:47:52 +08:00
Andy Green
9231afca4b test server allow set uid gid from cmdline
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-19 11:15:10 +08:00
Andy Green
3d4353650c windows plat correct assert test in lws_poll_listen_fd
After https://github.com/warmcat/libwebsockets/issues/430

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-18 21:01:27 +08:00
Andy Green
d7fddadaec context creation info add ecdh_curve
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-18 20:36:55 +08:00
Andy Green
79afbe34de test server SSL STS header delivery example
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-18 20:36:40 +08:00
Andy Green
a6d411fa92 test server allow only best quality ciphers
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-18 20:36:23 +08:00
Andy Green
78773b6da0 ssl add server ecdh curve init
Using "real" SSL certs requires some init for openssl ECDH
curve.  Add a default curve "prime256v1" and allow overriding it
at context creation time.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-18 20:36:09 +08:00
Andy Green
d32bb055ea test server allow external certs
Allow the test server to use external certs for testing

libwebsockets-test-server --ssl -C libwebsockets.org.crt -K libwebsockets.org.key -A libwebsockets.org.cer

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-17 11:58:51 +08:00
Andy Green
a0ca2d098b ssl ecdh check errors properly
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-17 11:09:58 +08:00
Andy Green
ff69648ae2 more documentation typos
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-17 07:46:27 +08:00
Peter Pentchev
834cb8525e Fix some typos. 2016-02-16 21:47:56 +08:00
Andy Green
bcb5ec5f4e debug reduce noise
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-16 18:48:10 +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
722da0b500 appveyor update openssl url
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-16 13:20:30 +08:00
Andy Green
0b85a64bf0 coverity 158147 test ping sprintf bounds
Well, just in the test app arg processing, but yes...

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 21:09:00 +08:00
Andy Green
0fba8e6ef8 coverity 158146 test fraggle sprintf bounds
Well, just in the test app arg processing, but yes...

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 21:07:09 +08:00
Andy Green
27966c29e1 coverity 158145 lws_header_table_detatch must handle no ah attached
callers should protect it so this doesn't make a problem.  But
Coverity is correct the code is confused about it.

Make it okay if we close a connection before the ah got attached.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 21:03:51 +08:00
Andy Green
1e32c2b67a release checklist coverity
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 21:03:51 +08:00
Andy Green
c62d882939 api doc update pre 1.7
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 21:03:51 +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
eb91ad0964 release checklist api updates
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 20:39:07 +08:00
Andy Green
c9259876d2 http_transaction_completed handle two completions in detach reset order
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 19:05:43 +08:00
Andy Green
2c218e705f ah owns rxbuf
This is intended to solve a longstanding problem with the
relationship between http/1.1 keep-alive and the service
loop.

Ah now contain an rx buffer which is used during header
processing, and the ah may not be detached from the wsi
until the rx buffer is exhausted.

Having the rx buffer in the ah means we can delay using the
rx until a later service loop.

Ah which have pending rx force POLLIN service on the wsi
they are attached to automatically, so we can interleave
general service / connections with draining each ah rx
buffer.

The possible http/1.1 situations and their dispositions are:

 1) exactly one set of http headers come.  After processing,
    the ah is detached since no pending rx left.  If more
    headers come later, a fresh ah is aqcuired when available
    and the rx flow control blocks the read until then.

 2) more that one whole set of headers come and we remain in
    http mode (no upgrade).  The ah is left attached and
    returns to the service loop after the first set of headers.
    We will get forced service due to the ah having pending
    content (respecting flowcontrol) and process the pending
    rx in the ah.  If we use it all up, we will detach the
    ah.

 3) one set of http headers come with ws traffic appended.
    We service the headers, do the upgrade, and keep the ah
    until the remaining ws content is used.  When we
    exhausted the ws traffix in the ah rx buffer, we
    detach the ah.

Since there can be any amount of http/1.1 pipelining on a
connection, and each may be expensive to service, it's now
enforced there is a return to the service loop after each
header set is serviced on a connection.

When I added the forced service for ah with pending buffering,
I added support for it to the windows plat code.  However this
is untested.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 14:57:55 +08:00
Andy Green
8acdd2e7ed autobahn wait for all fork completion
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 14:57:55 +08:00
Andy Green
b414d52066 autobahn put back 2.10 2.11
The test ordering breaks if we try to skip them, just
leave them in.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 14:57:55 +08:00
Andy Green
42f93ffbfa attack.sh add http1.1 pipelining check
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 14:57:55 +08:00
Andy Green
21f128433b release checklist qa
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-15 12:37:23 +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
Alex Hultman
19bb09133d port test-server-libuv.c from libev to libuv 2016-02-14 09:28:28 +08:00
Alex Hultman
a43c2ac272 libuv initial replace libev version 2016-02-14 07:31:44 +08:00
Andy Green
082e33b91f release-checklist 2016-02-13 12:08:30 +08:00