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

148 commits

Author SHA1 Message Date
Andy Green
a047d8582d configure add requirement for zlib.h
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:37:10 +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
ce6a21dbda introduce deflate compression extension
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:32:53 +00:00
Andy Green
6e5f95e401 allow extensions for parsing
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:15:34 +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
2366b1c997 instantiate extensions server accepted
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:15:31 +00:00
Andy Green
c6517fa2ad dynamically create client extensions offer from extensions list
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:15:29 +00:00
Andy Green
57b4e9af2b document extension callback reasons
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:14:46 +00:00
Andy Green
3b84c006c9 callback each active extension on packet tx pre send
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:14:42 +00:00
Andy Green
98a717c7ed callback each active extension on packet rx pre parse
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 13:14:15 +00:00
Andy Green
95a7b5d87d introduce lws_send_pipe_choked
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 10:29:39 +00:00
Andy Green
d44bf7f81b introduce lws_issue_raw
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 10:29:38 +00:00
Andy Green
ef660a9c20 deallocate extension contexts on connection close
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 10:29:38 +00:00
Andy Green
c511482c78 create server extension response dynamically
This goes through the extentsions the client requested, selects the ones
that we support at the server, and then further calls back to the appropriate
protocol callback in user code to check it's OK to actually use that
extension in this context.  If it is (callback unhandled == it is) then
it's added to the list of extensions sent back to the client.

Accepted extensions are also added to the connection's active extension
list and the private "user" memory allocation for the extension context is
done and bound to the connection.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-06 10:29:35 +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
Andy Green
2e24da08c4 fix openssl breakage from win32
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-05 16:12:04 +00:00
Andy Green
02770b412c win32 build fixup missing includes
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-05 09:04:23 +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
385e7ad034 introduce LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER
This adds a callback to protocols[0] which happens when the
Client HTTP handshake packet is being composed.  After all the
headers for the websocket handshake to the server have been
added, the callback is called with a pointer to a char *
that allows extra headers to be added.  See the comments in
libwebsocket.h or the api documentation for example code.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-01 21:06:02 +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
a54986f36e update README with known good OSX configure
Christopher Baker sent in a working OSX configure string,
add it to the README

Reported-by: Christopher Baker <me@christopherbaker.net>
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-28 07:48:27 +00:00
Andy Green
d4302734d7 fix null protocol dereference when closing session
Thanks to Christopher Baker for pointing out that when we close a session,
if the close is coming before a protocol was negotiated for the connection
or when the protocol was otherwise left at NULL, we'll blow a segfault.

This implements his proposed fix.

Reported-by: Christopher Baker <me@christopherbaker.net>
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-28 07:45:29 +00:00
Andy Green
4eaa86b291 only have nonce requirement and processing for exactly 04
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 11:17:48 +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
6da560c63c remove duplicated poll handling in hangup on client
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 11:06:27 +00:00
Andy Green
687b0188bc require close reason argument on close and free session
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 11:04:01 +00:00
Andy Green
06de513612 introduce 06 close status codes
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 10:40:02 +00:00
Andy Green
6274baf8c0 only send sec webscoket nonce on 04
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 10:31:41 +00:00
Andy Green
7942dfe282 make origin optional on server
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-26 10:28:15 +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
6901cb3b4e add callback for OpenSSL client cert verification action
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-21 08:06:47 +00:00
Andy Green
c6bf2c2186 add callback to allow additional server verification certs
This adds a LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS callback
which offers a chance for the server context to be loaded with additional
certtificates allowing it to verify incoming client certs.  The callback
always comes to protocol[0].

It also introduces the context option LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT
which will enforce client cert checking on any ssl connection.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-20 11:10:47 +00:00
Andy Green
0894bda184 add callback to allow additional client verification certs
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-19 09:09:11 +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
8c4041591e README update configure advice for apple
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-16 18:50:01 +00:00
Andy Green
1f9bf527ec fix ssl support and confirm builds clean when not configured
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 21:14:37 +00:00
Andy Green
038d582bde add include for gettimeofday even without ssl
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 20:58:26 +00:00
Darin Willits
db9ba42aad Only include anything from openssl if configured for it
Signed-off-by: Darin Willits <darin@willits.ca>
2011-02-14 20:56:24 +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
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
Timothy J Fontaine
b86d64eaa9 Fix refactor damage from missed debug-only print arg
Just a quick follow up there is a compile error at the moment, which I
think is resolved as the following?

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2011-02-14 17:55:27 +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
abbf461998 eliminate dummy 76 challenge content in 04 plus
Signed-off-by: Andy Green <andy@warmcat.com>
2011-02-14 09:14:24 +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
de6ab32861 clean-out-poll-array-when-hanging-up-on-client.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-13 09:15:10 +00:00
Andy Green
764ff98b2a uplevel-rpm-spec-to-include-new-extpoll-sample.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
2011-02-13 09:08:11 +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