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

559 commits

Author SHA1 Message Date
Andy Green
9a50ba844f fix misunderstood fragmentation restriction
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 21:14:23 +00:00
Andy Green
5d9d94ba09 add CONTINUATION write mode
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 20:47:41 +00:00
Andy Green
2836c641cf expose SHA1 api
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 20:47:41 +00:00
Andy Green
8acc194dc2 expose random api
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 20:47:40 +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
58eaa74fd0 remove bogus bytes on first line of websockets.c
Reported-by: Pierre-Paul Lavoie <ppl@idios.org>
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 17:54:06 +00:00
Andy Green
7c9c4d4dca add explicit libz inclusion
Reported-by: Pierre-Paul Lavoie <ppl@idios.org>
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 17:52:00 +00:00
Andy Green
c44159fb3a flush extensions when closing
Extensions might be caching stuff that we should spill before a controlled close.
It's not allowed to send anything on the wire after the close request, so we need
to make the extensions spill just before.

Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 07:08:18 +00:00
Andy Green
da527dfdee add extra state for waiting on close ack with timeout
Signed-off-by: Andy Green <andy@warmcat.com>
2011-03-07 07:08:12 +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
Pat McManus @Mozilla
2a8978feec interop notes - libwebsocket -06 close
... this afternoon I was just doing a little
interoperability testing around close... in my test-server I added

 libwebsocket_close_and_free_session(this, wsi, LWS_CLOSE_STATUS_NORMAL);

in order to generate a server driven close.. I hope that was the right
way to go about it. In any event, in generated an invalid websocket
frame - I think you want this patch, or something like it:

Signed-off-by: \"Pat McManus @Mozilla\" <mcmanus@ducksong.com>
2011-03-07 06:06:36 +00:00
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