Commit graph

212 commits

Author SHA1 Message Date
Andy Green
6d91d5f8a1 test ping correct type for fprintf
Reported-by: Michael Habeler <mail17@mah.priv.at>
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-12-02 08:42:47 +08:00
Andy Green
613bc32f73 test echo unbreak no server
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-12-01 22:16:17 +08:00
Andy Green
303f65fbe2 test echo versa + uri
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-12-01 21:46:35 +08:00
Andy Green
fb8f2b0a73 test echo add port to server host
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-12-01 21:02:55 +08:00
Andy Green
453a9b34fd coverity 83669 remove random from fraggle
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:55:40 +08:00
Andy Green
cbd98ed1e4 coverity 83663 remove random from test client
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:53:19 +08:00
Andy Green
b743623ff4 coverity 83683 test ping more uint64_t needed
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:37:23 +08:00
Andy Green
d7b0a72953 coverity 83658 test server check fstat return
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:10:26 +08:00
Andy Green
b17598bea2 coverity 83662 test server check lseek return
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:10:26 +08:00
Andy Green
0f59c9e75c coverity 83668 test echo nesting level bug
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 12:50:12 +08:00
Andy Green
6a33759bb1 83675 test echo param could bust bounds
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 12:42:14 +08:00
Andy Green
31fc6ff5b5 coverity 83682 suspicous signed bytewise reassembly
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 12:27:47 +08:00
Andy Green
56686d784c coverity 83683 shift greater than 31 technically undefined
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 12:25:36 +08:00
Andy Green
745a69e7ce test echo initialize listen port
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-26 14:36:17 +08:00
Andy Green
ba4e415006 clean test server a bit
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-26 12:04:29 +08:00
Joakim Soderberg
bf3e8a998e Subject: [PATCH] BUGFIX: Failed to get proper output dir for test-server
When creating the directory where to put the files needed by the test-server CMake would fail because it tried to create the directory /../share/libwebsockets-test-server, which is not possible. This happens since the TARGET_FILE_DIR for the test-server is not fetched properly.

Also mentioned in this trac ticket:
http://libwebsockets.org/trac/libwebsockets/ticket/84
2014-11-25 05:49:11 +08:00
Andy Green
752963da00 test-echo: enable for ssl cert serving and verification 2014-11-18 09:28:35 +08:00
Andy Green
5db6c0fa01 clean http2 passphrase code
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-05 15:32:58 +08:00
Andy Green
7df53c5550 http2 alpn npn pollout
This adds npn / alpn support if your openssl can handle it.
Then, browsers that understand alpn will by default
negotiate http/1.1 and work as normal.

Clients that understand http2.0 can negotiate h2-14 and
use the basic but working http2.0 support automatically

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-22 15:38:12 +08:00
Andy Green
200f385716 http2 track content length add END_STREAM
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-18 12:23:05 +08:00
Andy Green
91b0589795 http2 handle flags
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-17 09:33:16 +08:00
Andy Green
917f43ab82 http2 able to send test.html to nghttp2
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-12 14:31:47 +08:00
Andy Green
2add6340d5 http2 hpack basic decode ok including huff
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-12 08:38:16 +08:00
Andy Green
024eb6c80c http2 can keep upgraded connection up
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-08 12:00:53 +08:00
Andy Green
a54f232f07 http2 add h2c upgrade and http2 connmode
Connection upgrade handling for h2c
Establish http2 union struct and http2 connmode
No protocol code yet

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 09:43:14 +08:00
Andy Green
1ee42a5f05 add http2 settings token
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:27:29 +08:00
Andy Green
9887bdb438 test server correct header naming order
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:23:06 +08:00
Andy Green
14425eae4e introduce lws_partial_buffered
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-18 22:49:39 +08:00
Andy Green
7a8d86e048 handle client protocol lists properly
We fail to deal with lists of protocols sent by the client
by picking one from the list properly.  This fixes that and
adds protocol lists to the test client for regression testing.

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-19 06:52:39 +08:00
Andy Green
6aa4f65620 test server dumb increment fix once per second duplicate
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-06 09:36:44 +08:00
Andy Green
a717df2739 refactor libev eliminate all code ifdefs
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-11 13:14:37 +08:00
Andy Green
c5d3ed328b test server extend timeout while sending leaf
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 11:11:06 +08:00
Andy Green
158e804cb7 refactor out WIN32 tests from code
This gets rid of all the platform-dependent #ifdef stuff and
migrates it into the new lws-plat-xxx.c files.

These are then included in a one-time test in libwebsockets.c
according basically to Windows or not.

The idea is from now on, all Windows-specific code should go in
lws-plat-win.c, where any kind of Windows perversion like DWORD
is fine.

Any new functions going in there should be named lws_plat_...
and be defined in all the lws-plat-xxx.c file (currently just
win32 and unix platforms are supported).

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 14:25:10 +08:00
Patrick Gansterer
462c981e9c Move #define for random() into the test applications where needed 2014-03-29 08:05:07 +01:00
Patrick Gansterer
60cbbac880 Use Sleep() instead of usleep() on Windows 2014-03-29 07:52:01 +01:00
Patrick Gansterer
fc5734c339 Remove dummy headers for Windows 2014-03-29 07:43:38 +01:00
Patrick Gansterer
8df031d336 Remove emulated_poll on Windows 2014-03-29 07:15:40 +01:00
Patrick Gansterer
1ee57f6fe8 Add libwebsocket_cancel_service() to let a pending libwebsocket_service() return
Use poll() with a pipe instead of ppoll() to allow the stop polling
on all UNIX platforms.
2014-03-08 09:31:49 +08:00
Michael Haberler
099645dc05 update test server for new extpoll 2014-02-15 20:35:05 +08:00
Jakob Flierl
af8694d203 make force_exit volatile.
Instruct the compiler to always access force_exit in memory.
2014-02-15 13:51:16 +08:00
martell
19c73f3bed fixed windows build 2014-02-15 13:34:25 +08:00
Andy Green
3b3fa9e208 Use ppoll to allow signals to wake service loop early on change of pollfd event
To enable this code you need to force LWS_HAS_PPOLL to de defined.

#defining it at the top of libwebsockets.c is enough.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-12-25 16:34:37 +08:00
Andy Green
7a1327977a add locking callback for fds
This adds two new callbacks in protocols[0] that are optional for allowing limited thread
access to libwebsockets, LWS_CALLBACK_LOCK_POLL and LWS_CALLBACK_UNLOCK_POLL.

If you use them, they protect internal and external poll list changes, but if you want to use
external thread access to libwebsocket_callback_on_writable() you have to implement your
locking here even if you don't use external poll support.

If you will use another thread for this, take a lot of care about managing your list of
live wsi by doing it from ESTABLISHED and CLOSED callbacks (with your own locking).

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-12-18 09:48:26 +08:00
James Devine
5b34c975ae Optionally allow non-SSL connections on same port as SSL
If enabled one listening socket will accept both SSL and plain HTTP connections.

Do not enable if you regard SSL handshake as some kind of security, eg, use
client-side certs to restrict access.

AG: changed flag names, added extra comments, changelog, add -a in test server

Signed-off-by: James Devine <fxmulder@gmail.com>
Signed-off-by: Andy Green <andy@warmcat.com>
2013-12-14 11:41:29 +08:00
Christian Wyss
8ff88e9df0 distinguish error from truncation
Signed-off-by: Christian Wyss <christian.wyss@gfk.com>
2013-12-10 21:34:30 +08:00
John Harrison
8d5793bc16 ie10 lws url workaround
Signed-off-by: John Harrison <john@h-agtec.com>
2013-12-10 21:20:03 +08:00
Andy Green
2764eba89f handle EAGAIN during send
This patch deploys the truncated send work to buffer output in case
either send() or the SSL send return a temporary "unable to send"
condition even though they signalled as writeable.

I added a by-default #if 0 test jig which enforces only half of what
you want to send is sendable, this is working when enabled.

One subtle change is that the pipe reports choked if there is any
pending remaining truncated send.  Otherwise it should be transparent.

Hopefully...

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-12-09 14:16:17 +08:00
kapejod
ce64fb0f58 Support for HTTP POST.
Rewritten by Andy Green to use chunks, add timeout, use extra states in handshake not parser.

Signed-off-by: Andy Green <andy@warmcat.com>
2013-11-24 10:36:37 +08:00
Andy Green
1e3f7b8de9 introduce uri args
If the URI coming from the client contains '?' then

 - the URI part is terminated with a '\0'

 - the remainder of the URI goes in a new header WSI_TOKEN_HTTP_URI_ARGS

 - the remainder of the URI is not subject to path sanitization measures (it
    still has %xx processing done on it)

In the test server, http requests now also dump header information to stderr.

The attack.sh script is simplified and can now parse the test server header dumps.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-11-13 07:45:17 +08:00
Andy Green
d3f6873942 back up directory paths properly
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-11-13 06:53:21 +08:00