Andy Green [Fri, 3 May 2013 13:13:35 +0000 (21:13 +0800)]
log err if unable to open http file
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 2 May 2013 00:15:53 +0000 (08:15 +0800)]
trac 29 convert more snprintf stowaways
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 1 May 2013 23:04:54 +0000 (07:04 +0800)]
trac 29 echo remoe mention of syslog constants for win32
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 29 Apr 2013 22:53:56 +0000 (06:53 +0800)]
trac 29 avoid syslog in echo test if win32
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 29 Apr 2013 22:51:10 +0000 (06:51 +0800)]
trac 29 eliminate snprintf again
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 27 Apr 2013 00:33:26 +0000 (08:33 +0800)]
trac 29 win32 EWOULDBLOCK
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 25 Apr 2013 23:37:16 +0000 (07:37 +0800)]
Trac 29: win32 fix LWS_VISIBLE issue
Reported-by: davetaflin
Signed-off-by: Andy Green <andy.green@linaro.org>
Bob Roberts [Thu, 25 Apr 2013 01:16:30 +0000 (09:16 +0800)]
cygwin compatibility
Signed-off-by: Bob Roberts <bobroberts177@gmail.com>
thinkski [Tue, 16 Apr 2013 11:48:05 +0000 (19:48 +0800)]
trac 27: use fullpath in OSX dynamic libs
Signed-off-by: thinkski <chiszp@gmail.com>
thinkski [Fri, 12 Apr 2013 02:31:46 +0000 (10:31 +0800)]
pkg config avoid hardcoded prefix
Signed-off-by: thinkski <chiszp@gmail.com>
Tomas Cejka [Thu, 11 Apr 2013 00:13:13 +0000 (08:13 +0800)]
cmake use existing spec file for RPM generation
Signed-off-by: Tomas Cejka <cejkat@cesnet.cz>
Tomas Cejka [Thu, 11 Apr 2013 00:38:02 +0000 (08:38 +0800)]
cmake added RPM generation
Signed-off-by: Tomas Cejka <cejkat@cesnet.cz>
Andy Green [Sat, 30 Mar 2013 02:30:03 +0000 (10:30 +0800)]
cmake improve cross documentation
Signed-off-by: Andy Green <andy.green@linaro.org>
Peter Pentchev [Sat, 30 Mar 2013 01:52:21 +0000 (09:52 +0800)]
Hide private library symbols
Signed-off-by: Peter Pentchev <roam@ringlet.net>
Andy Green [Sat, 23 Mar 2013 01:53:17 +0000 (09:53 +0800)]
SOL_SNDBUF set to protocol rx size
This tells the OS to reserve a TX buffer at least the size of the biggest RX frame
expected, for both server and client connections.
In Linux, the OS reserves 2 x the requested amount.
This is aimed at reducing the partial large atomic frame send problem to the point
it's only coming at large atomic frames the OS balks at reserving the size for.
If you have a lot of data to send, it is better to split it into multiple writes,
and use the FIN / CONTINUATION websocket stuff to manage it.
See the "fraggle" test app for example code of how to do that.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 23 Mar 2013 01:46:18 +0000 (09:46 +0800)]
test server improve return checking
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 23 Mar 2013 01:44:47 +0000 (09:44 +0800)]
cosmetic debug improvements
Signed-off-by: Andy Green <andy.green@linaro.org>
Joakim Soderberg [Sat, 23 Mar 2013 00:55:28 +0000 (08:55 +0800)]
BUGFIX: Properly add libcyassl to the lib list.
This would cause failure to build the test apps with CyaSSL.
Joakim Soderberg [Sat, 23 Mar 2013 00:55:02 +0000 (08:55 +0800)]
Check for GCC/G++ explicitly instead of simply Unix.
Since we're setting gcc specific build flags.
Joakim Soderberg [Mon, 18 Mar 2013 17:08:25 +0000 (17:08 +0000)]
Allow setting the resource path via command line.
It is awfully limiting when you have to set the resource path at compile time.
Instead also allow setting it via the --resource_path command line option.
Andy Green [Sat, 16 Mar 2013 04:32:27 +0000 (12:32 +0800)]
introduce api for unthrottle all connections of protocol
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 16 Mar 2013 04:34:36 +0000 (12:34 +0800)]
test client have u option also reject deflate stream
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 16 Mar 2013 04:32:59 +0000 (12:32 +0800)]
cmake add gcc compile options
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 16 Mar 2013 03:24:23 +0000 (11:24 +0800)]
rxflow remove recursion and simplify
Signed-off-by: Andy Green <andy.green@linaro.org>
Tobias Maier [Thu, 14 Mar 2013 12:02:23 +0000 (13:02 +0100)]
replaced last remaining close on wsi->sock with compatible_close
Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
Michel Archambault [Thu, 14 Mar 2013 15:45:49 +0000 (11:45 -0400)]
Fixed read of the jpg in Windows
Windows needs to open things with _O_BINARY
Signed-off-by: Michel Archambault <marchamb@matrox.com>
Andy Green [Mon, 11 Mar 2013 12:37:03 +0000 (20:37 +0800)]
update service_fd comment and api docs
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 23:16:04 +0000 (07:16 +0800)]
cmake update specfile
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 10 Mar 2013 00:09:25 +0000 (08:09 +0800)]
cmake add missing echo test app
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 10 Mar 2013 00:10:19 +0000 (08:10 +0800)]
cmake packageconfig installs to lib dir
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 10 Mar 2013 00:11:48 +0000 (08:11 +0800)]
cmake ignore non source things for make dist
Signed-off-by: Andy Green <andy.green@linaro.org>
Gregory Junker [Sat, 9 Mar 2013 23:16:26 +0000 (07:16 +0800)]
android include gregorys example makefile
Signed-off-by: Gregory Junker <ggjunker@gmail.com>
Andy Green [Sat, 9 Mar 2013 22:59:01 +0000 (06:59 +0800)]
update version 1.3 soname 4
Signed-off-by: Andy Green <andy.green@linaro.org>
Edwin van den Oetelaar [Sat, 9 Mar 2013 22:53:57 +0000 (06:53 +0800)]
cmake some cosmetic improvementss
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Edwin van der Oetelaar [Sat, 9 Mar 2013 22:43:29 +0000 (06:43 +0800)]
autotools remove INSTALL m4 COPYING
Also get rid of m4/ and COPYING, it's a copy of LGPL2.1 but without the
exceptions we added in LICENSE.
Signed-off-by: Edwin van der Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 05:06:37 +0000 (13:06 +0800)]
remove autotools build
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 05:03:53 +0000 (13:03 +0800)]
document revent clearing scheme
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 04:34:30 +0000 (12:34 +0800)]
clear down wsi_lookup on allocation and clear pollfd revents if serviced
This should get rid of a valgrind uninitialized report when using extpoll,
and gives a new way to share the poll loop with external sockets.
If a pollfd says it has something, you can just pass it to
libwebsocket_serice_fd() whether it is a socket handled by lws or not.
If it sees it is a lws socket, the traffic will be handled and
pollfd->revents will be zeroed now.
If the socket is foreign to lws, it leaves revents alone. So you can see
if you should service by checking the pollfd revents after letting
lws try to service it.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 04:54:14 +0000 (12:54 +0800)]
reduce httpd close debug spew
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 04:51:43 +0000 (12:51 +0800)]
cmake fix install path
Signed-off-by: Andy Green <andy.green@linaro.org>
Alex Rhatushnyak [Sat, 9 Mar 2013 04:01:47 +0000 (12:01 +0800)]
correct example lws_write in header
Signed-off-by: Alex Rhatyshnyak <a.rhatushnyak@klervi.com>
Andy Green [Sat, 9 Mar 2013 03:52:18 +0000 (11:52 +0800)]
dont leak when protocol agreement probs
Signed-off-by: Andy Green <andy.green@linaro.org>
Henrik Abelsson [Thu, 7 Mar 2013 14:52:53 +0000 (15:52 +0100)]
Fix printf format error
Signed-off-by: Henrik Abelsson <henrik@abelsson.com>
Andy Green [Sat, 9 Mar 2013 01:16:41 +0000 (09:16 +0800)]
cmake win32 change helper includes to HDR_PUBLIC so they install
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 01:09:05 +0000 (09:09 +0800)]
dont sweat unkknown method for client
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 9 Mar 2013 01:09:46 +0000 (09:09 +0800)]
POLLOUT during wait for server response not an error
Signed-off-by: Andy Green <andy.green@linaro.org>
Arokux B [Tue, 5 Mar 2013 00:41:47 +0000 (08:41 +0800)]
fix win32helpers gettimeofday epoch
Signed-off-by: Arokux B <arokux@gmail.com>
Andy Green [Thu, 28 Feb 2013 09:11:29 +0000 (17:11 +0800)]
trace 22 fix zero length close from client
close() from javascript api in Chrome and Firefox doesn't do the
right thing. It's because the payload is zero-length (with a frame
key...) This fixes it.
Reported-by: 巫书轶
Signed-off-by: Andy Green <andy.green@linaro.org>
Arokux B [Thu, 28 Feb 2013 01:25:02 +0000 (09:25 +0800)]
cmake mingw no need for websock w32
2. Comment out this line
http://git.warmcat.com/cgi-bin/cgit/libwebsockets/tree/CMakeLists.txt#n279
the file websock-w32.c is already compiled indirectly from libwebsockets.c
Signed-off-by: Arokux B <arokux@gmail.com>
Andy Green [Thu, 28 Feb 2013 01:22:38 +0000 (09:22 +0800)]
normalize formatting in gettimeofday
Signed-off-by: Andy Green <andy.green@linaro.org>
Arokux B [Thu, 28 Feb 2013 01:18:38 +0000 (09:18 +0800)]
fix win32 gettimeofday for mingw
here are the problems that I found while compiling libwebsockets with
CMake using as a generator MinGW Makefiles.
1. In http://git.warmcat.com/cgi-bin/cgit/libwebsockets/plain/win32port/win32helpers/gettimeofday.c
Remove spaces around time.h, otherwise it looks for " time.h " and
fails with "No such file ..."
I also needed to comment out
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
It is already declared in mingw's time.h
Signed-off-by: Arokux B <arokux@gmail.com>
Andy Green [Tue, 26 Feb 2013 03:58:45 +0000 (11:58 +0800)]
cmake lib lib64 problem
As discussed here, there's a semi-standardized way to inform
cmake that the install target wants its libs in .../lib64
https://code.google.com/p/bullet/issues/detail?id=174
this patch adds the necessary fiddling
Signed-off-by: Andy Green <andy.green@linaro.org>
Luc [Sat, 23 Feb 2013 03:01:21 +0000 (11:01 +0800)]
fix mime type on leaf header
Signed-off-by: Luc <luc@honk-honk.com>
Andy Green [Sat, 23 Feb 2013 02:50:10 +0000 (10:50 +0800)]
reflect send completeness in lws_write return
under load, writing packet sizes to the socket that are normally fine
can do partial writes, eg asking to write 4096 may only take 2800 of
it and return 2800 from the actual send.
Until now lws assumed that if it was safe to send, it could take any
size buffer, that's not the case under load.
This patch changes lws_write to return the amount actually taken...
that and the meaning of it becomes tricky when dealing with
compressed links, the amount taken and the amount sent differ. Also
there is no way to recover at the moment from a protocol-encoded
frame only being partially accepted... however for http file send
content it can and does recover now.
Small frames don't have to take any care about it but large atomic
sends (> 2K) have been seen to fail under load.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 22 Feb 2013 01:54:35 +0000 (09:54 +0800)]
move ssl cipher list from compiletime to context creation time option
More flexible this way... NULL for the new member means use
the ssl library default set of ciphers, so as long as your info
struct is zerod by bss or memset, you don't need to do anything
about this change unless you want to set the cipher list.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 22 Feb 2013 01:38:54 +0000 (09:38 +0800)]
remove MAX_HEADER_NAME_LENGTH from header
Still lurking aound as a ghost after all real usess of it
were removed with the minilex changes.
Signed-off-by: Andy Green <andy.green@linaro.org>
Joakim Soderberg [Fri, 22 Feb 2013 01:28:17 +0000 (09:28 +0800)]
Fix running test programs from within visual studio.
Copy test-server data to a path so that we can run the test-server from
within visual studio without having to copy stuff around.
Joakim Soderberg [Fri, 22 Feb 2013 01:28:15 +0000 (09:28 +0800)]
Print SSL error codes as well as the string.
CYASSL doesn't compile with the error strings in some configurations, so
it is nice to have the error code on SSL errors as well.
Joakim Söderberg [Fri, 22 Feb 2013 01:28:13 +0000 (09:28 +0800)]
Set the _DEBUG macro for CMake also.
Joakim Soderberg [Fri, 22 Feb 2013 01:28:11 +0000 (09:28 +0800)]
Fixed ssl cert generation on Windows.
Joakim Soderberg [Fri, 22 Feb 2013 01:28:08 +0000 (09:28 +0800)]
Added CPack support + some more.
- "make dist" will now produce a tar.gz file. This includes everything (not really what we want but a start).
- Got rid of a bunch of defines and variables that aren't used.
- Added the option LINK_TESTAPPS_DYNAMIC that enables linking to the shared library version of the lib for the test apps, instead of doing it statically like the default is.
- Fixed proper support for the --prefix stuff (-DCMAKE_INSTALL_PREFIX for cmake). (Don't specify /usr/local explicitly, that is the default anyway and will break other platforms).
- Note: I noticed a problem with the "INSTALL_DATADIR" define used by the test-apps. Since we hard code the path to the certs using this, doing "DESTDIR=/bla make install" will result in not being able to use the SSL mode for the test-apps since they won't find the certs. (This also applies to the autoconf project). Fixed this by setting "../share" as the default location instead of using the prefix.
Joakim Soderberg [Fri, 22 Feb 2013 01:28:06 +0000 (09:28 +0800)]
BUGFIX: Fixed bug for installing test-apps for CMake.
Appending to the TEST_APP_LIST variable function did not work from within the create_test_app function (It would create a function scope variable with the same name and discard it). We instead need to use a macro for this.
The previous commit also removed the duplicate install for the test-apps (because we want all the install steps in one place in the file for clarity). That change made it obvious that the TEST_APP_LIST never gets populated.
Joakim Soderberg [Fri, 22 Feb 2013 01:28:04 +0000 (09:28 +0800)]
Fixed CMake compile options.
Fixed so that the build options for the CMake project works:
- The test apps used the LWS_NO_EXTENSIONS define, so they needed lws_config.h included when building using CMake.
- Rename some options so that individual test apps can be turned off.
- Separate building the test-client/test-server and compiling the server/client parts into the lib.
- Don't include server or client specific sources into the build if they shouldn't be built.
- Added an error if both client and server parts are excluded at the same time (makes no sense).
- Removed duplicate install targets for the test apps.
- Commented out the WITH_LIBCRYPTO option since it isn't used at the moment.
Joakim Soderberg [Fri, 22 Feb 2013 01:28:02 +0000 (09:28 +0800)]
getifaddrs missing more user friendly in CMake.
Don't require the user to enable using the built-in BSD getifaddrs implementation on systems such as uclibc that lacks it manually.
Instead if getifaddrs doesn't exist, use the BSD one automatically, except if the user explicitly tells the user not to do this using WITHOUT_BUILTIN_GETIFADDRS (which will result in a compilation error, but at least with a nice error message explaining why).
Joakim Soderberg [Fri, 22 Feb 2013 01:27:59 +0000 (09:27 +0800)]
Fix LWS_NO_SERVER build.
"int n" was used also when server parts are not compiled, so don't put it inside the LWS_NO_SERVER ifdef.
Joakim Soderberg [Fri, 22 Feb 2013 01:27:57 +0000 (09:27 +0800)]
Bugfix compiling for cross compiling.
! does not mean NOT, use NOT instead :)
Larry Hayes [Fri, 22 Feb 2013 01:16:20 +0000 (09:16 +0800)]
keepalive swap interval and probes
The interval and probes members for setting keepalive options
per-connection on Linux were swapped.
Signed-off-by: Larry Hayes <lhayesg@gmail.com>
Edwin van den Oetelaar [Wed, 20 Feb 2013 12:56:59 +0000 (20:56 +0800)]
provide socketfd at in param for LWS_CALLBACK_FILTER_NETWORK_CONNECTION
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Wed, 20 Feb 2013 11:11:31 +0000 (19:11 +0800)]
trac 18 deal with service connection timing out
While looking at http://libwebsockets.org/trac/ticket/18
noticed the flow for timeout in service_fd will do bad things
if the fd we came to service has timed out. It gets freed and
then "serviced'.
Reported-by: Joakim Soderberg <joakim.soderberg@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Edwin van den Oetelaar [Tue, 19 Feb 2013 18:08:51 +0000 (02:08 +0800)]
cmake fix for older cmake
AG this wasn't needed on cmake 2.8.10.2 but did not make any
problem either
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Andy Green [Tue, 19 Feb 2013 11:19:51 +0000 (19:19 +0800)]
update missed extpoll calls to use correct args for ssl
http://libwebsockets.org/trac/ticket/15#comment:16
Reported-by: Joakim Soderberg <joakim.soderberg@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Tue, 19 Feb 2013 02:26:39 +0000 (10:26 +0800)]
cmake docs add note about prefix
Signed-off-by: Andy Green <andy.green@linaro.org>
Joakim Söderberg [Tue, 19 Feb 2013 02:14:54 +0000 (10:14 +0800)]
Create the "doc" dir before generating docs.
The documentation wouldn't be generated if the path didn't exist.
Joakim Söderberg [Tue, 19 Feb 2013 02:14:37 +0000 (10:14 +0800)]
Added "make install" support to the CMake project.
- Does everything as the autoconf script does (I think).
- Generates SSL certs for the test-server
- Installs all test apps.
- Defaults to /usr/local/
- "DESTDIR=/bla make install" works
- Append "libwebsockets" to start of the test-app names like the autoconf stuff does.
- Only tested on OSX so far...
Andy Green [Tue, 19 Feb 2013 02:01:48 +0000 (10:01 +0800)]
trac 17 update set_log_level api notice
http://libwebsockets.org/trac/ticket/17
Reported-by: dbrnz
Signed-off-by: Andy Green <andy.green@linaro.org>
Edwin van den Oetelaar [Mon, 18 Feb 2013 12:20:05 +0000 (20:20 +0800)]
move cms cmake addition to cmake module paths earlier
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Andy Green [Mon, 18 Feb 2013 10:34:10 +0000 (18:34 +0800)]
add FindGit.cmake
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 08:54:26 +0000 (16:54 +0800)]
document ensure_user_space going private
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 08:30:10 +0000 (16:30 +0800)]
remove lws_ensure_user_space from public api change return
The function has a logical problem when the size of the requested
allocation is 0, it will return NULL which is overloaded as
failure.
Actually the whole function is evil as an api, this patch moves
it out of the public API space and fixes it to return 0 for
success or 1 for fail. Private code does not need to to return
wsi->user_space and public code should only get that from the
callback as discussed on trac recently.
Thanks to Edwin for debugging the problem.
Reported-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 04:08:15 +0000 (12:08 +0800)]
update arm build stats
Clean out the historical numbers, update info
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 04:02:18 +0000 (12:02 +0800)]
trim proxy ads plus hostname stg
128 should be fine for hostname and proxy ads
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 03:32:49 +0000 (11:32 +0800)]
restrict http send buffer to 4096
send() is able to complete but not send everything asked...
we don't deal with that yet. On an ARM9 board, leaf.jpg
failed because the send() only accepted 7240 of 8192... not
a failure but it implies reporting partial send to the
caller. Work around by keeping the send buffer at 4096.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 02:43:18 +0000 (10:43 +0800)]
fix no extensions build
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 02:38:45 +0000 (10:38 +0800)]
migrate client hs and c_port into ah
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 02:34:25 +0000 (10:34 +0800)]
minor type optimizations
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 02:29:22 +0000 (10:29 +0800)]
remove current_alloc_len
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 02:22:42 +0000 (10:22 +0800)]
remove header name buffer
The header name buffer and its max length handling has actually
been unused since the minilex parser was introduced. We hold
parsing state in the lex-type parts and don't need to store or
worry about max length, since the parser will let us know as
soon as it can't be a match for the valid header names.
This strips it out reducing the per-connection allocation for
x86_64 with default configure from 224 to 160.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Mon, 18 Feb 2013 01:48:31 +0000 (09:48 +0800)]
handle http union transition properly
There's no proper transition to http union state until now.
It only becomes apparant there's a problem when you try to
return -1 from the HTTP callback, during the close action
it will try to close() a nonsense, nonzero fd pointer in
the uninitialized u.http union member.
This patch takes a copy of the allocated headers struct from
the u.hdr union state, transitions to u.http clearing down u
and then calls the HTTP callback with URI args pointing to
the still-in-scope ah allocation. After the call, the copy ah
is freed.
That makes sure we are in the correct union state while still
giving the HTTP callback access to the URI without having to
copy it around.
Reported-by: Edwin can den Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sun, 17 Feb 2013 01:14:08 +0000 (09:14 +0800)]
test server kill skt with minus 1
The client spams the server with mirror protocol content
and then closes the connection. However the server wants to
send that content back to all the mirror protocol
connections, including the one that closed.
The result is during the send back phase we usually see an
error trying to send to the close client connection. Because
we don't return -1, we don't close it on server side and the
error repeats a lot before finally closing. This is a side-
effect of a recent patch to drain pending input before
really closing a dead connection.
This patch just changes it to return -1 on the failed send
attempt assertively closing the connection.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Sat, 16 Feb 2013 02:17:52 +0000 (10:17 +0800)]
handle any POLLIN before error
See if this can impact http://libwebsockets.org/trac/ticket/16
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 15 Feb 2013 14:48:58 +0000 (22:48 +0800)]
close if we tried to close politely just close next time
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 15 Feb 2013 14:36:30 +0000 (22:36 +0800)]
api change deliver socket fd to in param of extpoll callbacks
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 15 Feb 2013 14:32:53 +0000 (22:32 +0800)]
problems in lws_handle_POLLOUT_event should just close
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 15 Feb 2013 14:31:55 +0000 (22:31 +0800)]
robustness protect and document ensure_user_space
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Fri, 15 Feb 2013 02:25:58 +0000 (10:25 +0800)]
README.coding add note about closing connections
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Feb 2013 15:06:37 +0000 (23:06 +0800)]
add by hand http send example
This adds a demonstration of how to use the http nonblocking
send action to the test server.
If you ask for /leaf.jpg from the test server, it will send
"by hand" a 2.4MB jpeg in HTTP, including the headers. See
the test server sources to see how it is done.
Although it's a file, and a jpeg image, actually the exact
same scheme will work for any data or mime type.
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Feb 2013 15:18:10 +0000 (23:18 +0800)]
create user alloc for http if requested
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Feb 2013 14:23:54 +0000 (22:23 +0800)]
introduce LWS_CALLBACK_HTTP_WRITEABLE
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Feb 2013 09:11:22 +0000 (17:11 +0800)]
just get hostname into canonical_hostname
Signed-off-by: Andy Green <andy.green@linaro.org>
Andy Green [Thu, 14 Feb 2013 09:02:26 +0000 (17:02 +0800)]
remove getnameinfo
Signed-off-by: Andy Green <andy.green@linaro.org>