profile/ivi/libwebsockets.git
11 years agoAdded private macro CIPHERS_LIST_STRING to define ciphers list string. 60/2860/1
David Galeano [Thu, 10 Jan 2013 02:15:19 +0000 (10:15 +0800)]
Added private macro CIPHERS_LIST_STRING to define ciphers list string.

11 years agoWhen choosing a cipher, use the server's preferences. 59/2859/1
David Galeano [Thu, 10 Jan 2013 02:14:12 +0000 (10:14 +0800)]
When choosing a cipher, use the server's preferences.

11 years agoPass URI length to LWS_CALLBACK_HTTP. 58/2858/1
David Galeano [Thu, 10 Jan 2013 02:13:19 +0000 (10:13 +0800)]
Pass URI length to LWS_CALLBACK_HTTP.

11 years agoDisable compression for SSL socket, 57/2857/1
David Galeano [Thu, 10 Jan 2013 02:11:57 +0000 (10:11 +0800)]
Disable compression for SSL socket,
it is a waste of CPU when using compression extensions.

11 years agoUsing "SSL_CTX_use_certificate_chain_file" instead of "SSL_CTX_use_certificate_file" 56/2856/1
David Galeano [Thu, 10 Jan 2013 02:11:21 +0000 (10:11 +0800)]
Using "SSL_CTX_use_certificate_chain_file" instead of "SSL_CTX_use_certificate_file"
to support server certificates signed by intermediaries.

11 years agoBetter definition of "debug" macro for Win32 builds. 55/2855/1
David Galeano [Thu, 10 Jan 2013 02:08:50 +0000 (10:08 +0800)]
Better definition of "debug" macro for Win32 builds.

11 years agoUse __inline for Win32 builds. 54/2854/1
David Galeano [Thu, 10 Jan 2013 02:07:16 +0000 (10:07 +0800)]
Use __inline for Win32 builds.

11 years agoAvoid checking choked pipe if no extension has more data to write. 53/2853/1
David Galeano [Thu, 10 Jan 2013 02:06:38 +0000 (10:06 +0800)]
Avoid checking choked pipe if no extension has more data to write.

11 years agozlib update 1.2.7 52/2852/1
David Galeano [Thu, 10 Jan 2013 02:03:42 +0000 (10:03 +0800)]
zlib update 1.2.7

Signed-off-by: Andy Green <andy.green@linaro.org>
11 years agoSet listen backlog to SOMAXCONN. 51/2851/1
David Galeano [Thu, 10 Jan 2013 01:58:24 +0000 (09:58 +0800)]
Set listen backlog to SOMAXCONN.

11 years agoFixed operator precedence bug. 50/2850/1
David Galeano [Thu, 10 Jan 2013 01:54:10 +0000 (09:54 +0800)]
Fixed operator precedence bug.

11 years agoAvoid deflate of small packets. 49/2849/1
David Galeano [Thu, 10 Jan 2013 01:51:15 +0000 (09:51 +0800)]
Avoid deflate of small packets.

11 years agoSupport compressed packets bigger than MAX_USER_RX_BUFFER. 48/2848/1
David Galeano [Thu, 10 Jan 2013 01:41:06 +0000 (09:41 +0800)]
Support compressed packets bigger than MAX_USER_RX_BUFFER.
(AG adapted style and removed logging stuff)

11 years agoAllow extensions when no protocol was specified. 47/2847/1
David Galeano [Wed, 9 Jan 2013 11:49:50 +0000 (19:49 +0800)]
Allow extensions when no protocol was specified.

11 years agoAdded extension "deflate-frame". 46/2846/1
David Galeano [Wed, 9 Jan 2013 10:21:33 +0000 (18:21 +0800)]
Added extension "deflate-frame".
Using by default instead of "deflate-stream".

11 years agoAdded support for extensions that only manipulate application data. 45/2845/1
David Galeano [Wed, 9 Jan 2013 10:06:55 +0000 (18:06 +0800)]
Added support for extensions that only manipulate application data.

11 years agoFixed deflate-stream extension. 44/2844/1
David Galeano [Wed, 9 Jan 2013 10:03:28 +0000 (18:03 +0800)]
Fixed deflate-stream extension.
When the output buffer was exhausted the input buffer was discarded
without checking if zlib had actually consumed all the input,
now we copy the remaining input data for the next call.

11 years agoAdded private macro AWAITING_TIMEOUT instead of harcoded value 5. 43/2843/1
David Galeano [Wed, 9 Jan 2013 10:01:23 +0000 (18:01 +0800)]
Added private macro AWAITING_TIMEOUT instead of harcoded value 5.

11 years agoFixed spacing. 42/2842/1
David Galeano [Wed, 9 Jan 2013 08:35:18 +0000 (16:35 +0800)]
Fixed spacing.

11 years agoAdded context creation parameter for CA certificates file. 41/2841/1
David Galeano [Wed, 9 Jan 2013 08:25:54 +0000 (16:25 +0800)]
Added context creation parameter for CA certificates file.

11 years agoReturn NULL if the handshake failed to complete, 40/2840/1
David Galeano [Wed, 9 Jan 2013 08:17:04 +0000 (16:17 +0800)]
Return NULL if the handshake failed to complete,
libwebsocket_service_fd closes and frees the websocket in that case.

11 years agoIgnoring linux build files 39/2839/1
David Galeano [Wed, 9 Jan 2013 07:46:11 +0000 (15:46 +0800)]
Ignoring linux build files

11 years agoUse feature check rather than browser check. 38/2838/1
David Galeano [Wed, 9 Jan 2013 07:39:50 +0000 (15:39 +0800)]
Use feature check rather than browser check.

11 years agoChanged client handshake to use "Origin" instead of "Sec-WebSocket-Origin" as defined... 37/2837/1
David Galeano [Wed, 9 Jan 2013 07:31:46 +0000 (15:31 +0800)]
Changed client handshake to use "Origin" instead of "Sec-WebSocket-Origin" as defined by RFC 6455 when using version 13 of the protocol.

11 years agoFixed compiler warnings on Windows. 36/2836/1
David Galeano [Wed, 9 Jan 2013 07:29:00 +0000 (15:29 +0800)]
Fixed compiler warnings on Windows.

11 years agoAdded new status codes from RFC 6455. 35/2835/1
David Galeano [Wed, 9 Jan 2013 07:26:08 +0000 (15:26 +0800)]
Added new status codes from RFC 6455.

11 years agoFixed compiler warning on Windows. 34/2834/1
David Galeano [Wed, 9 Jan 2013 07:25:05 +0000 (15:25 +0800)]
Fixed compiler warning on Windows.

11 years agorequired version of autoconf can be lower 33/2833/1
Artem Baguinski [Wed, 9 Jan 2013 07:16:52 +0000 (15:16 +0800)]
required version of autoconf can be lower

11 years agoStatic variable is now const. 32/2832/1
David Galeano [Wed, 9 Jan 2013 07:14:31 +0000 (15:14 +0800)]
Static variable is now const.

11 years agoadd context construction option to skip server hostname lookup 31/2831/1
Andy Green [Mon, 22 Oct 2012 11:29:57 +0000 (12:29 +0100)]
add context construction option to skip server hostname lookup

Signed-off-by: Andy Green <andy.green@linaro.org>
11 years agoadd missing docs for new context user pointer 30/2830/1
Andy Green [Fri, 19 Oct 2012 10:36:28 +0000 (18:36 +0800)]
add missing docs for new context user pointer

Signed-off-by: Andy Green <andy.green@linaro.org>
11 years agolibwebsocket_service_fd: EAGAIN is harmless, treat like EINTR 29/2829/1
Alon Levy [Fri, 19 Oct 2012 09:21:57 +0000 (11:21 +0200)]
libwebsocket_service_fd: EAGAIN is harmless, treat like EINTR

Only tested on linux.

Signed-off-by: Alon Levy <alevy@redhat.com>
11 years agolibwebsocket_context: add userspace pointer for use before wsi creation 28/2828/1
Alon Levy [Fri, 19 Oct 2012 09:21:56 +0000 (11:21 +0200)]
libwebsocket_context: add userspace pointer for use before wsi creation

Signed-off-by: Alon Levy <alevy@redhat.com>
11 years agolib/Makefile.am: whitespace fix 27/2827/1
Alon Levy [Fri, 19 Oct 2012 09:21:55 +0000 (11:21 +0200)]
lib/Makefile.am: whitespace fix

Signed-off-by: Alon Levy <alevy@redhat.com>
11 years agoadd pkg-config file libwebsockets.pc 26/2826/1
Alon Levy [Fri, 19 Oct 2012 09:21:54 +0000 (11:21 +0200)]
add pkg-config file libwebsockets.pc

Signed-off-by: Alon Levy <alevy@redhat.com>
11 years agoAdded test.html favicon.ico to EXTRA_DIST. 25/2825/1
Anders Brander [Wed, 17 Oct 2012 12:23:28 +0000 (14:23 +0200)]
Added test.html favicon.ico to EXTRA_DIST.

11 years agoAdd missing .h files to sources. 24/2824/1
Anders Brander [Wed, 17 Oct 2012 11:48:59 +0000 (13:48 +0200)]
Add missing .h files to sources.

11 years agoAdd kernel doc to extra_dist. 23/2823/1
Anders Brander [Wed, 17 Oct 2012 11:47:47 +0000 (13:47 +0200)]
Add kernel doc to extra_dist.

11 years agoalways taking an interest in ppid wont hurt 22/2822/1
Andy Green [Wed, 17 Oct 2012 12:10:44 +0000 (20:10 +0800)]
always taking an interest in ppid wont hurt

Signed-off-by: Andy Green <andy.green@linaro.org>
11 years agoremove depcomp 21/2821/1
Andy Green [Sun, 7 Oct 2012 12:44:02 +0000 (20:44 +0800)]
remove depcomp

Signed-off-by: Andy Green <andy.green@linaro.org>
11 years agostop being so fragile on socket lifecycle 20/2820/1
Andy Green [Sun, 7 Oct 2012 12:40:35 +0000 (20:40 +0800)]
stop being so fragile on socket lifecycle

Signed-off-by: Andy Green <andy.green@linaro.org>
11 years agouse autogen.sh 19/2819/1
Andy Green [Sat, 6 Oct 2012 07:17:01 +0000 (15:17 +0800)]
use autogen.sh

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoUpdating changelog 23/1623/1 1.0 1.0_branch accepted/2.0/20130306.212354 accepted/trunk/20120905.234502 submit/2.0/20130306.215142 submit/trunk/20120905.231624
Rusty Lynch [Wed, 5 Sep 2012 23:15:16 +0000 (16:15 -0700)]
Updating changelog

12 years agoAdding Tizen packaging files 63/1563/1
Rusty Lynch [Thu, 23 Aug 2012 02:28:37 +0000 (19:28 -0700)]
Adding Tizen packaging files

12 years agoadd not about autoreconf and libtoolize upstream 1.2
Andy Green [Fri, 20 Jul 2012 05:00:12 +0000 (13:00 +0800)]
add not about autoreconf and libtoolize

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agorestore accept error as closure signal
Andy Green [Fri, 20 Jul 2012 04:58:38 +0000 (12:58 +0800)]
restore accept error as closure signal

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agocheck for prctl, poll parent PID if not present
Artem Baguinski [Wed, 14 Dec 2011 21:14:03 +0000 (22:14 +0100)]
check for prctl, poll parent PID if not present

this allows forking code to be used on non-linux systems

12 years agoFixing uninitialised memory
Paulo Roberto Urio [Mon, 4 Jun 2012 02:52:19 +0000 (10:52 +0800)]
Fixing uninitialised memory

These were found with valgrind tool.
Signed-off-by: Paulo Roberto Urio <paulourio@gmail.com>
12 years agosome toolchains need stddef
Paulo Roberto Urio [Mon, 4 Jun 2012 01:04:33 +0000 (09:04 +0800)]
some toolchains need stddef

Signed-off-by: Paulo Roberto Urio <paulourio@gmail.com>
12 years agoadd missing sa_data init to canonical hostname code
Andy Green [Mon, 4 Jun 2012 00:53:26 +0000 (08:53 +0800)]
add missing sa_data init to canonical hostname code

Shay noticed we're no longer initializing the initial lookup of
server canonical hostname correctly

Reported-by: Shay Zuker <shay@boxee.tv>
Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoFixed segfault in libwebsocket_context_destroy.
Paulo Roberto Urio [Mon, 4 Jun 2012 00:40:28 +0000 (08:40 +0800)]
Fixed segfault in libwebsocket_context_destroy.

When creating a context with NULL extensions list,
a segmentation fault was yelled when trying to
destroy the context.  This checks if the
extension list is NULL before go through the list.
Signed-off-by: Paulo Roberto Urio <paulourio@gmail.com>
12 years agosockets were left open if connection could not be
Tobias Maier [Wed, 30 May 2012 04:46:42 +0000 (12:46 +0800)]
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>
12 years agolink lz explicitly for mips
yuval tal [Mon, 21 May 2012 02:16:06 +0000 (10:16 +0800)]
link lz explicitly for mips

    fix link error since libz is not linked in

Signed-off-by: yuval tal <yuvalt@boxee.tv>
12 years agonull exception with null extensions list
Andrew Chambers [Sun, 20 May 2012 00:17:09 +0000 (08:17 +0800)]
null exception with null extensions list

I was under the impression extensions could be null, so heres a patch to fix this error in libwebsockets. Cheers!

Signed-off-by: Andrew Chambers <andrewchamberss@gmail.com>
--

12 years agorefresh autotools stuff
Andy Green [Sun, 20 May 2012 00:17:02 +0000 (08:17 +0800)]
refresh autotools stuff

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoupdate test html now mozilla uses normal ws apis
Andy Green [Thu, 3 May 2012 04:48:14 +0000 (12:48 +0800)]
update test html now mozilla uses normal ws apis

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agostart migration to getnameinfo
Andy Green [Thu, 3 May 2012 04:32:38 +0000 (12:32 +0800)]
start migration to getnameinfo

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoopenssl allow connect multiple packets for SSL_connect
Ken Atherton [Thu, 3 May 2012 03:45:04 +0000 (11:45 +0800)]
openssl allow connect multiple packets for SSL_connect

Ken found over the internet with real delays, SSL_connect can
fail to work.  This patch adapts his workaround to stay in the
connect state until we either run out of time for the connect
or succeed.

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Ken Atherton <katherton@echofirst.com>
12 years agocleanup extra wrapping needed on braced define
Andy Green [Thu, 3 May 2012 03:17:08 +0000 (11:17 +0800)]
cleanup extra wrapping needed on braced define

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoandroid toolchain SHA1 endian fix
Peter Hillier [Tue, 1 May 2012 22:09:45 +0000 (06:09 +0800)]
android toolchain SHA1 endian fix

Android toolchain needs an extra include if it's not to confuse
SHA-1 code probably with incorrect endian-ness from missing /bits/

Signed-off-by: Peter Hillier <peterhillier@yahoo.com>
Signed-off-by: Andy Green <andy@warmcat.com>
12 years agossize_t needs help on windows
David Brooks [Tue, 1 May 2012 22:02:45 +0000 (06:02 +0800)]
ssize_t needs help on windows

ssize_t is needed, but absent in Windows.

This patch typedefs it to an int in that case as recommended by Tobias.

Signed-off-by: Andy Green <andy@warmcat.com>
Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
Reported-by: Rich Gossweiler <rich.gossweiler@gmail.com>
12 years agointroduce libwebsocket_client_connect_extended
David Brooks [Fri, 20 Apr 2012 04:19:01 +0000 (12:19 +0800)]
introduce libwebsocket_client_connect_extended

Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--

12 years agointroduce LWS_CALLBACK_CLIENT_CONNECTION_ERROR
David Brooks [Fri, 20 Apr 2012 04:18:47 +0000 (12:18 +0800)]
introduce LWS_CALLBACK_CLIENT_CONNECTION_ERROR

Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--

12 years agoset connection callback before connection completed to allow early messages
David Brooks [Fri, 20 Apr 2012 04:16:52 +0000 (12:16 +0800)]
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(-)

12 years agoimprove callback prototypes to use single definition
David Brooks [Fri, 20 Apr 2012 04:13:50 +0000 (12:13 +0800)]
improve callback prototypes to use single definition

Not sure all compilers can hack this, but give it a try

Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--

12 years agoreduce debug spew
David Brooks [Fri, 20 Apr 2012 04:13:37 +0000 (12:13 +0800)]
reduce debug spew

Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--

12 years agoworkaround osx compiler bug
Pasi Mankinen [Fri, 13 Apr 2012 23:28:19 +0000 (07:28 +0800)]
workaround osx compiler bug

Signed-off-by: Pasi Mankinen <pasi.t.mankinen@student.jyu.fi>
12 years agodocument mingw build
Andy Green [Thu, 12 Apr 2012 05:32:47 +0000 (13:32 +0800)]
document mingw build

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agomingw add win32helper to lib and fix extpoll
Andy Green [Thu, 12 Apr 2012 05:26:49 +0000 (13:26 +0800)]
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>
12 years agodoc add explanation missing from per context provate data
Andy Green [Thu, 12 Apr 2012 03:15:23 +0000 (11:15 +0800)]
doc add explanation missing from per context provate data

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agomingw add zlib paths
Andy Green [Thu, 12 Apr 2012 03:11:10 +0000 (11:11 +0800)]
mingw add zlib paths

Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoremove duplicated netdb include from client handshake
Andy Green [Thu, 12 Apr 2012 03:08:55 +0000 (11:08 +0800)]
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>
12 years agochange DATADIR to INSTALL_DATADIR solve mingw conflict
Andy Green [Thu, 12 Apr 2012 03:06:05 +0000 (11:06 +0800)]
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>
12 years agomingw gettimeofday avoid missing include
Andy Green [Thu, 12 Apr 2012 03:02:06 +0000 (11:02 +0800)]
mingw gettimeofday avoid missing include

Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agomingw add in missing poll defs
Andy Green [Thu, 12 Apr 2012 02:56:20 +0000 (10:56 +0800)]
mingw add in missing poll defs

Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agomingw hide some missing includes
Andy Green [Thu, 12 Apr 2012 02:54:22 +0000 (10:54 +0800)]
mingw hide some missing includes

Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoautoconf introduce enable mingw and adapt compiler options
Andy Green [Thu, 12 Apr 2012 02:11:29 +0000 (10:11 +0800)]
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>
12 years agostyle cleaning
Andy Green [Mon, 9 Apr 2012 07:09:01 +0000 (15:09 +0800)]
style cleaning

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agofix onopen browser context patch
Andy Green [Mon, 9 Apr 2012 07:23:47 +0000 (15:23 +0800)]
fix onopen browser context patch

Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoallow message processing from onopen browser context
Yonathan Yusim [Sun, 8 Apr 2012 22:42:39 +0000 (06:42 +0800)]
allow message processing from onopen browser context

Found an issue in libwebsockets - if a server sends a message within its "onopen" context then the message is getting swallowed and not passed to calling client (means LWS_CALLBACK_CLIENT_RECEIVE is never getting called).
I've fixed the bug - pls find attached patch.

Signed-off-by: Yonathan Yusim <yonathan@boxee.tv>
Signed-off-by: Andy Green <andy@warmcat.com>
12 years agouse ssize_t instead of size_t for return values of read/recv/SSL_read
Tobias Maier [Thu, 5 Apr 2012 09:57:12 +0000 (11:57 +0200)]
use ssize_t instead of size_t for return values of read/recv/SSL_read

Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
12 years agomake duplicate headers append instead of get ignored
Nick Dowell [Thu, 5 Apr 2012 02:31:48 +0000 (10:31 +0800)]
make duplicate headers append instead of get ignored

The code to prevent memory leaks caused by reallocating a wsi->utf8_token
was also causing wsi->parser_state to not be updated, preventing the
handshake from completing.

This patch changes the logic to append to previous allocation which is
correct behaviour actually.

Signed-off-by: Nick Dowell <nick@nickdowell.com>
Signed-off-by: Andy Green <andy@warmcat.com>
12 years agoclose connection if socket recv() fails.
Nick Dowell [Thu, 5 Apr 2012 02:29:39 +0000 (10:29 +0800)]
close connection if socket recv() fails.

This prevents a problem observed on Windows whereby a client that
disconnects before fully establishing the WebSocket would cause the
server to use 100% CPU since recv() would continually return -1 for that
socket.

Signed-off-by: Nick Dowell <nick@nickdowell.com>
12 years agofix heap corruption if HTTP callback calls libwebsocket_close_and_free_session
Nick Dowell [Thu, 5 Apr 2012 02:29:29 +0000 (10:29 +0800)]
fix heap corruption if HTTP callback calls libwebsocket_close_and_free_session

Signed-off-by: Nick Dowell <nick@nickdowell.com>
12 years agomap wsorigin on to origin at an early point and stop dupe header mem leaks
Andy Green [Tue, 3 Apr 2012 15:02:20 +0000 (17:02 +0200)]
map wsorigin on to origin at an early point and stop dupe header mem leaks

Carlo wrote

''I'm interested to use the libwebsockets server (C based) with a Java
websocket client. I was able to implement a Java websocket client based
on JWebSocket library that works fine with the libwebsockets server, but
I was obliged to patch the libwebsockets server in order to reach my
goal. In particular I patched the handshake_00() function because
JWebSocket library uses hixie 76 version. The problem was that the
JWebSocket library sends only WSI_TOKEN_SWORIGIN token instead
WSI_TOKEN_ORIGIN token. For this reason the handshake_00 failed because
the token length of WSI_TOKEN_ORIGIN was 0. I have written a patch in
order to control if at least one of the two tokens (WSI_TOKEN_SWORIGIN
and WSI_TOKEN_ORIGIN) is defined. I have attached into the e-mail the
patch. Probably it can be written better, but in any case I think that
this problem should be fixed for client/server compatibility.''

I found a simpler approach which is convert WSORIGIN processing to
go into ORIGIN token at the earliest point, then everything else can
stay the same.

I also noticed we would leak on duplicated headers and fixed that.

Reported-by: Carlo PARATA <carlo.parata@st.com>
Signed-off-by: Andy Green <andy@warmcat.com>
12 years agohandle unsupported protocol correctly
Nick Dowell [Tue, 3 Apr 2012 16:22:19 +0000 (17:22 +0100)]
handle unsupported protocol correctly

Hi Andy,

First off, thanks for libwebsockets :-)

I've encountered a crash when a client connects to a libwebsockets server
but speicifies an unsupported protocol (Sec-WebSocket-Protocol).
handshake.c should probably be checking that wsi->protocol->name is not
null before doing a strcmp with it...
Attached is a patch for your consideration.

Cheers!
Nick

Signed-off-by: Nick Dowell <nick@nickdowell.com>
12 years agofix issuing null extension header if none supported
Andy Green [Thu, 29 Mar 2012 01:27:13 +0000 (09:27 +0800)]
fix issuing null extension header if none supported

Josh realized that with new Chrome, because we don't support the type of
compression extension yet we returned a null extension header.

This patch fixes that by deferring issuing the extension header until we
find we have something to say.

tested OK on google-chrome 19.0.1081.2-129295

Reported-by: Josh Roberson <josh@asteriasgi.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
12 years agoDon't care for the human-readable part of "HTTP/1.1 101" reply
Artem Egorkine [Wed, 23 Nov 2011 08:46:24 +0000 (10:46 +0200)]
Don't care for the human-readable part of "HTTP/1.1 101" reply

While the protocol specification gives example of the
human-readable message associated with a 101-code reply,
nowhere does it actually enforce it. Ws4py gevent middleware
is known to have a message other than "Switching Protocols".

13 years agocleanup fixes tested on win32 compiler
Dan Zhang [Wed, 9 Nov 2011 07:55:16 +0000 (15:55 +0800)]
cleanup fixes tested on win32 compiler

Signed-off-by: Dan Zhang <emaildanzhang@gmail.com>
13 years agowin32 poll emulation clean and address PEEK issue
Andy Green [Tue, 8 Nov 2011 23:28:45 +0000 (07:28 +0800)]
win32 poll emulation clean and address PEEK issue

Dan Zhang needed to defeat the recv() with PEEK in order to get working
poll() emulation on 64-bit windows.

I cleaned up the style in that file and made a version of his workaround
(which was force recv result to 0).  I can't test the result so it may
need more work.

Reported-by: Dan Zhang <emaildanzhang@gmail.com>
Signed-off-by: Andy Green <andy@warmcat.com>
13 years agodebug move most spew into debug macro
Andy Green [Mon, 7 Nov 2011 11:53:23 +0000 (19:53 +0800)]
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>
13 years agoAdd libwebsockets_ensure_user_space
Alex Bligh [Mon, 7 Nov 2011 09:19:25 +0000 (17:19 +0800)]
Add libwebsockets_ensure_user_space

This patch unifies the code for per-connection user allocation, and allows
it to be allocated earlier, duiring HTTP service time.  It's also OK to
attempt allocation multiple times, it will just return any existing
allocation.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
13 years agoadd missing win32 zlib pieces
David Galeano [Tue, 4 Oct 2011 12:59:24 +0000 (20:59 +0800)]
add missing win32 zlib pieces

Signed-off-by: David Galeano <davidgaleano@turbulenz.biz>
13 years agohttp charsets have case insensitive tokens
Oleg Golosovskiy [Tue, 4 Oct 2011 12:20:14 +0000 (20:20 +0800)]
http charsets have case insensitive tokens

 Andy,

According http://www.ietf.org/rfc/rfc2616.txt HTTP character sets are identified by case-insensitive tokens.

Please replase

                     if (strcmp(lws_tokens[n].token, wsi->name_buffer))
                           continue;

to

                     if (stricmp(lws_tokens[n].token, wsi->name_buffer))
                           continue;

Oleg

Also introduce strcasecmp definition for win32

Signed-off-by: Oleg Golosovskiy <ogolosovskiy@unison.com>
13 years agoAdded support for Windows XP.
David Galeano [Tue, 4 Oct 2011 11:55:18 +0000 (19:55 +0800)]
Added support for Windows XP.

13 years agoAdded BYTE_ORDER definition for win32 builds.
David Galeano [Mon, 3 Oct 2011 11:30:27 +0000 (19:30 +0800)]
Added BYTE_ORDER definition for win32 builds.

13 years agodoc LWS_EXTERN
Andy Green [Mon, 3 Oct 2011 11:30:22 +0000 (19:30 +0800)]
doc LWS_EXTERN

Signed-off-by: Andy Green <andy@warmcat.com>
13 years agozlib update
David Galeno [Mon, 26 Sep 2011 16:33:45 +0000 (17:33 +0100)]
zlib update

Signed-off-by: David Galeno <davidgaleano@turbulenz.biz>
13 years agoAdded "Release DLL" configuration.
David Galeano [Mon, 26 Sep 2011 16:30:34 +0000 (17:30 +0100)]
Added "Release DLL" configuration.

13 years agoAdded LWS_EXTERN to allow building a DLL.
David Galeano [Mon, 26 Sep 2011 11:17:20 +0000 (12:17 +0100)]
Added LWS_EXTERN to allow building a DLL.
Signed-off-by: David Galeano <davidgaleano@turbulenz.biz>