1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

46 commits

Author SHA1 Message Date
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
Tobias Maier
d1db83c650 sockets were left open if connection could not be
established resulting in a mass of unusable open file
 descriptors

Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
2012-05-30 12:46:42 +08:00
David Brooks
2c60d9584e introduce libwebsocket_client_connect_extended
Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--
2012-04-20 12:28:14 +08:00
David Brooks
993343b5e4 set connection callback before connection completed to allow early messages
Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--

 lib/client-handshake.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
2012-04-20 12:27:24 +08:00
Andy Green
796ce7ab15 remove duplicated netdb include from client handshake
Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
2012-04-12 13:31:36 +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
6ee372fcd8 style cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
2012-04-09 15:24:22 +08:00
Andy Green
cc01247c50 debug move most spew into debug macro
This quietens the spew so all typical debug info now is coming from
the user code (mirror protocol in the sample server / client case).

Signed-off-by: Andy Green <andy@warmcat.com>
2011-11-07 19:53:23 +08:00
David Galeano
f70093583b Fixed compiler warnings.
Signed-off-by: David Galeano <davidgaleano@turbulenz.biz>
2011-09-26 12:09:54 +01:00
M K
f24311527e Fix compile issue on Apple
Signed-off-by: M K <mkroehnert42@googlemail.com>
2011-09-25 10:34:35 +01:00
Andy Green
d85cb2083d v08v13 add support v13 default
Signed-off-by: Andy Green <andy@warmcat.com>
2011-09-25 09:32:54 +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
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
33872cd376 carry over 06 stuff to 07
Signed-off-by: Andy Green <andy@warmcat.com>
2011-04-24 05:49:44 +01:00
Andy Green
72c34321d3 Revert Pavel's patch looping in recv
Signed-off-by: Andy Green <andy@warmcat.com>
2011-04-16 10:46:21 +01:00
Pavel Borzenkov
876534b0d5 recv() may not return all data
While performing handshake recv() is called only once.
It may return only part of the data and handshake
will fail. This patch modifies libwebsocket_service_fd()
to ensure that there is not data left in the socket.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@auriga.com>
2011-04-15 13:16:58 +01:00
Pavel Borzenkov
71ea500081 Use IPPROTO_TCP instead of SOL_TCP
This change fixes compilation on *BSD systems.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@auriga.com>
2011-04-15 13:16:32 +01:00
Andy Green
6c9395529e disable nagle algorithm
Ago noticed that some Windows clients experience small packets
from the server being aggregated and set after a long delay
(200-300ms).

He found that TCP_NODELAY on the socket solved this, I tested it
and it didn't have any noticable bad effect, so I implemented it
for all sockets, client and server.

Thans Ago for debugging this and notifying the cause.

Reported-by: Ago Allikmaa <maxorator@gmail.com>
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-08 08:56:57 +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
eeaacb39c7 introduce 76 00 client support
This adds 76/00 client support to libwebsockets.  It's still shipped
by browsers and more importantly still the only version supported by
server stuff like socket.io.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-01 20:44:24 +00:00
Andy Green
9514bf8839 carry over 05 specific stuff to 06
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 11:13:56 +00:00
Andy Green
193306ca2d change default client version to 06
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 11:08:46 +00:00
Andy Green
08d33926eb make origin optional on client
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 10:22:49 +00:00
Andy Green
be93fefa76 break client connect into states and apply timeout
Doing a client connect was atomic until now, blocking
all the other service while it waited for proxy and / or
server response.

This patch uses the new timeout system and breaks the
client connect sequence into three states handled by
the normal poll() processing.  It means that there are
now no blocking network delays and it's all handled
by the main state machine.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 20:25:43 +00:00
Andy Green
a71eafce5a introduce timeout system
This adds a concept of timeouts for operations enforced by
connection closure if the timeout is reached.

Once a second all sockets are checked for timing out, every time
there is a service call it checks to see if a second has passed since
the last check and checks if so.

You can also call libwebsocket_service_fd() with a NULL fd to give
the timeouts a chance to be detected; if it's less than a second since
the last check it returns immediately.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 17:59:43 +00:00
Darin Willits
c19456f64a Apple / iOS build compatability patch
This allows build on iOS platform, thanks Darin!

Signed-off-by: Darin Willits <darin@willits.ca>
2011-02-14 17:52:39 +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
4b6fbe125e unify server and client close
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 08:03:48 +00:00
Andy Green
3221f92b1e introduce-external-poll-callbacks.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-12 13:14:11 +00:00
Andy Green
0d33833764 decouple-service-from-fd-array-index.patch
This patch removes the relationship between position in the
pollfd[] array and any meaning about the type of socket.

It also refactors the service loop so there is a per-fd
function that detects the mode of the connection and services
it accordingly.

The context wsi * array is removed and a hashtable introduced
allowing fast wsi lookup from just the fd that it is
associated with

Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-12 11:57:43 +00:00
Andy Green
44eee688ac optimize-random-device-open.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-10 09:32:24 +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
f3d3b40364 change-client-mode-to-enum.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-09 07:16:34 +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
927eb7b90d fix-error-path-on-server-headers-wrong.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-01 08:52:55 +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
Andy Green
d655cb4f82 fix-client-close.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-30 12:15:22 +00:00
Andy Green
864d9026a8 add-user-allocation-for-client-connects.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-30 11:43:51 +00:00
Andy Green
5b9a4c0d43 cleanup-proxy-code--add-timeout.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-28 09:39:29 +00:00
Andy Green
02244bb889 correct-proxy-fail-connect-handling.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-28 09:01:19 +00:00
Andy Green
9659f37967 introduce-http_proxy-support-no-auth.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-27 22:01:43 +00:00
Andy Green
90c7cbcc00 introduce-ssl-client-connections--flow-control.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-27 06:26:52 +00:00
Andy Green
6964bb5ee5 clean--fix-sigpipe.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-23 16:50:33 +00:00
Andy Green
4739e5c450 introduce-client-support.patch
Signed-off-by: Andy Green <andy@warmcat.com>
2011-01-22 12:51:57 +00:00