Commit graph

282 commits

Author SHA1 Message Date
Edwin van der Oetelaar
5e59bf15e1 optimize extpoll fd delete
Previous method of shifting back array by one to cover the deleted
item could be expensive when the list was large and the deleted item
appeared early in it.

This scheme swaps the last guy into the vacant space and reduces the
list size by one.

(AG adapted for style and not to care if n is end guy)

Signed-off-by: Edwin van der Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-15 15:50:28 +08:00
Andy Green
43063dd250 add longlived option to test client
Needed to confirm pending timeouts won't kill the connection, by default
it spams the server with connections that live less than 5s

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-15 15:43:17 +08:00
Andy Green
f7609e9ada logging ensure everyone has a newline
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-15 15:41:15 +08:00
Andy Green
24b588b6d9 absorb README.rst into main README and code
Some of the advice in README.rst became deprecated with recent patches,
the (good) advice about http connection close is better demonstrated
in the code and API docs, and the remainder can go in the main README,
which will have to be refactored itself at some point.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-13 09:53:18 +08:00
Andy Green
de8f27a80b logging extend level set api to allow setting emission function
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-12 09:17:42 +08:00
Andy Green
46ef0cf3c5 allow enabling debug contexts from test apps
Adds a -d switch to everything so you can set the log level bitfeld.

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-01-10 23:34:33 +08:00
David Galeano
2f82be89d5 Added context creation parameter for CA certificates file. 2013-01-09 16:25:54 +08:00
David Galeano
a3a97d1acc Ignoring linux build files 2013-01-09 15:46:11 +08:00
David Galeano
b42dcc7186 Use feature check rather than browser check. 2013-01-09 15:39:50 +08:00
Alon Levy
0291eb3b95 libwebsocket_context: add userspace pointer for use before wsi creation
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-10-19 18:27:19 +08:00
Anders Brander
88f8d5754c Added test.html favicon.ico to EXTRA_DIST. 2012-10-17 20:26:44 +08:00
Andy Green
94c62c652c use autogen.sh
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-10-06 15:17:01 +08:00
Andy Green
3928f6178a restore accept error as closure signal
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-07-20 12:58:38 +08:00
yuval tal
e59d477c07 link lz explicitly for mips
fix link error since libz is not linked in

Signed-off-by: yuval tal <yuvalt@boxee.tv>
2012-05-21 10:16:06 +08:00
Andy Green
13f7791d0c refresh autotools stuff
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-05-20 08:17:02 +08:00
Andy Green
86e82ab22f update test html now mozilla uses normal ws apis
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-05-03 12:48:14 +08:00
Andy Green
cf56e4dd0f cleanup extra wrapping needed on braced define
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-05-03 11:17:08 +08:00
Andy Green
aa6fc44b0a mingw add win32helper to lib and fix extpoll
Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
2012-04-12 13:32:19 +08:00
Andy Green
cce2a81e85 change DATADIR to INSTALL_DATADIR solve mingw conflict
Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
2012-04-12 13:31:25 +08:00
Andy Green
0dbef49e54 autoconf introduce enable mingw and adapt compiler options
Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
2012-04-12 10:11:29 +08:00
Andy Green
6ee372fcd8 style cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-04-09 15:24:22 +08:00
Andy Green
188d896c81 test html uplevel detect browser and MozWebSocket
Signed-off-by: Andy Green <andy@warmcat.com>
2011-09-25 10:01:02 +01:00
Andy Green
66a16f393e x google mux implement child close
This implements clean client and server close for mux child connections,
and deals with accounting for parent child lists.

The mux link can then survive constant connection bringup and teardown
found in the new test client.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-05-24 22:07:45 +01:00
Andy Green
7448c7ee0b test client add flag to defeat mux extension
Signed-off-by: Andy Green <andy@warmcat.com>
2011-05-24 22:06:17 +01:00
Andy Green
4084af1745 test client make mirror data source channel open and close all the time
This changes the test client so that for the mirror protocol socket,
the lifetime of the connection is decided randomly to last on the order
of a second or so, then the connection is closed and a new one opened when
the close is complete.

This is to enhance testing of connection bringup and teardown especially
in mux case.

The overall functionality remains the same, spamming circles to all clients.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-05-24 22:06:17 +01:00
Andy Green
a41314f3bf introduce x google mux very draft indeed
This is initial x-google-mux support.  It's disabled by default
since it's very pre-alpha.

1) To enable it, reconfigure with --enable-x-google-mux

2) It conflicts with deflate-stream, use the -u switch on
   the test client to disable deflate-stream

3) It deviates from the google standard by sending full
   headers in the addchannel subcommand rather than just
   changed ones from original connect

4) Quota is not implemented yet

5) Close of subchannel is not really implemented yet

6) Google opcode 0xf is changed to 0x7 to account for
   v7 protocol changes to opcode layout

However despite those caveats, in fact it can run the
test client reliably over one socket (both dumb-increment
and lws-mirror-protocol), you can open a browser on the
same test server too and see the circles, etc.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-05-23 10:00:03 +01:00
Andy Green
5948865eb6 beautify fraggle
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-09 09:21:24 +00:00
Andy Green
98a623fa46 clean fraggle
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-08 08:43:59 +00:00
Andy Green
e9739ed203 introduce fraggle test app
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 21:40:59 +00:00
Andy Green
9e4c2b6e35 add separate server writeable and change naming to match rest of callbacks
Notice that the naming is changed, the notification to a server that it can write to
the client is now called LWS_CALLBACK_SERVER_WRITEABLE, and the notification to a client
that it can write to a server is LWS_CALLBACK_CLIENT_WRITEABLE.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 20:47:39 +00:00
Andy Green
69758fa809 introduce test server close testing switch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 07:08:07 +00:00
Andy Green
775884edd2 add compression defeat switch to test client
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:32:53 +00:00
Andy Green
4cd87a0bd9 introduce internal extensions array
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:15:32 +00:00
Andy Green
d6e09110bb introduce struct libwebsocket_extension
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-05 16:12:15 +00:00
Peter Hinz
56885f3084 introduce win32 build capability
This adds win32 build compatability to libwebsockets.

The patch is from Peter Hinz, Andy Green has cleaned it up a bit and
possibly broken win32 compatability since I can't test it, so there
may be followup patches.  It compiles fine under Linux after this
patch anyway.

Much of the patch is changing a reserved keyword for Visual C compiler
"this" to "context", but there is no real C99 support in the MSFT
compiler even though it is 2011 so C99 style array declarations
have been mangled back into "ancient C" style.

Some windows-isms are also added like closesocket() but these are
quite localized.  Win32 random is just using C library random() call
at the moment vs Linux /dev/urandom.  canonical hostname detection is
broken in win32 at the moment.

Signed-off-by: Peter Hinz <cerebusrc@gmail.com>
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-02 22:03:47 +00:00
Andy Green
32375b7e9e introduce listen on specific interface
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-19 08:32:53 +00:00
Andy Green
b3ae0a36af make test client notice if server closed on him
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 20:25:43 +00:00
Andy Green
62c54d2f56 introduce this param in callback fix server close on client socket
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 09:14:25 +00:00
Andy Green
e2acfc86b3 use-new-peer-name-api-in-ping.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-13 09:05:54 +00:00
Andy Green
38c4f0c556 add-example-protocol-handshake-filter-callback.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-13 08:54:05 +00:00
Andy Green
863d4d25e7 add-example-network-filter-callback.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-13 08:40:37 +00:00
Andy Green
0703409235 introduce-network-connect-filter-callback.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-13 08:37:12 +00:00
Andy Green
2a5aa6537d add-ext-poll-callbacks-in-extpoll-test.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-12 13:15:04 +00:00
Andy Green
2e5de82da2 introduce-libwebsockets-test-server-extpoll.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-12 12:07:23 +00:00
Andy Green
5e1fa17a6c introduce-new-05-socket-closure-rules.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-10 09:07:05 +00:00
Andy Green
bfb051f3a3 introduce-ietf-05-framing-and-commandline-options.patch
This adds 05 support, and -v switches on test-client and test-ping
to allow setting their ietf protocol version to 4 or 5.

It also optimizes the masking to us a function pointer, which
takes some conditionals out of the fast path.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-09 08:49:14 +00:00
Andy Green
1efb63c2be fix-hostname-to-be-server-name--allow-switches-in-any-order.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-06 17:42:06 +00:00
Andy Green
990d5062d0 add-k-opt-to-test-client.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-30 21:04:24 +00:00
Andy Green
8014b29d20 introduce-k-switch-defeat-masking.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-30 20:57:25 +00:00
Andy Green
6a98054a36 fix-context-close.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-30 20:40:32 +00:00