Commit graph

2159 commits

Author SHA1 Message Date
Andy Green
d91561c2f6 trac 29 eliminate snprintf again
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-04-30 06:51:10 +08:00
Andy Green
4e414e65bb trac 29 win32 EWOULDBLOCK
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-04-27 08:33:26 +08:00
Andy Green
3661d7be53 Trac 29: win32 fix LWS_VISIBLE issue
Reported-by: davetaflin
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-04-26 07:37:16 +08:00
Bob Roberts
ac04911dde cygwin compatibility
Signed-off-by: Bob Roberts <bobroberts177@gmail.com>
2013-04-25 09:16:30 +08:00
thinkski
d34bae15d3 trac 27: use fullpath in OSX dynamic libs
Signed-off-by: thinkski <chiszp@gmail.com>
2013-04-16 19:48:05 +08:00
thinkski
dd93a0c416 pkg config avoid hardcoded prefix
Signed-off-by: thinkski <chiszp@gmail.com>
2013-04-12 10:31:46 +08:00
Tomas Cejka
efda177e80 cmake use existing spec file for RPM generation
Signed-off-by: Tomas Cejka <cejkat@cesnet.cz>
2013-04-11 08:38:22 +08:00
Tomas Cejka
f35fd9789a cmake added RPM generation
Signed-off-by: Tomas Cejka <cejkat@cesnet.cz>
2013-04-11 08:38:22 +08:00
Andy Green
5b479ac2f1 cmake improve cross documentation
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-30 10:30:03 +08:00
Peter Pentchev
9a4fef7ed6 Hide private library symbols
Signed-off-by: Peter Pentchev <roam@ringlet.net>
2013-03-30 09:52:21 +08:00
Andy Green
01b206e804 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>
2013-03-23 09:53:17 +08:00
Andy Green
3390efd7c3 test server improve return checking
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-23 09:46:18 +08:00
Andy Green
98ba9e01b4 cosmetic debug improvements
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-23 09:44:47 +08:00
Joakim Soderberg
9c037c05fb BUGFIX: Properly add libcyassl to the lib list.
This would cause failure to build the test apps with CyaSSL.
2013-03-23 08:55:28 +08:00
Joakim Soderberg
c2012e40ed Check for GCC/G++ explicitly instead of simply Unix.
Since we're setting gcc specific build flags.
2013-03-23 08:55:02 +08:00
Joakim Soderberg
f0ee6696f4 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.
2013-03-23 08:54:41 +08:00
Andy Green
b55451c6d2 introduce api for unthrottle all connections of protocol
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-16 12:43:22 +08:00
Andy Green
5c9fcacd7a test client have u option also reject deflate stream
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-16 12:43:22 +08:00
Andy Green
da3f6ffdbf cmake add gcc compile options
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-16 12:37:40 +08:00
Andy Green
ca0a129065 rxflow remove recursion and simplify
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-16 11:24:23 +08:00
Tobias Maier
37029d9081 replaced last remaining close on wsi->sock with compatible_close
Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
2013-03-15 07:26:19 +08:00
Michel Archambault
e8c00aa47e Fixed read of the jpg in Windows
Windows needs to open things with _O_BINARY

Signed-off-by: Michel Archambault <marchamb@matrox.com>
2013-03-15 07:25:15 +08:00
Andy Green
2577c831f4 update service_fd comment and api docs
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-11 20:37:03 +08:00
Andy Green
b2637a3978 cmake update specfile
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:12:12 +08:00
Andy Green
27696f2596 cmake add missing echo test app
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:12:06 +08:00
Andy Green
c8c166221d cmake packageconfig installs to lib dir
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:12:01 +08:00
Andy Green
2aab3f9513 cmake ignore non source things for make dist
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 08:11:48 +08:00
Gregory Junker
c3872c5fe0 android include gregorys example makefile
Signed-off-by: Gregory Junker <ggjunker@gmail.com>
2013-03-10 07:34:53 +08:00
Andy Green
19c1a99b59 update version 1.3 soname 4
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-10 07:34:53 +08:00
Edwin van den Oetelaar
15a38a788f cmake some cosmetic improvementss
Signed-off-by: Edwin van den Oetelaar <oetelaar.automatisering@gmail.com>
2013-03-10 07:34:53 +08:00
Edwin van der Oetelaar
2fd02fc0b8 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>
2013-03-10 06:43:29 +08:00
Andy Green
0097a99082 remove autotools build
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 13:06:37 +08:00
Andy Green
58f214ea0c document revent clearing scheme
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 13:03:53 +08:00
Andy Green
b1a5e6c377 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>
2013-03-09 12:56:35 +08:00
Andy Green
25eddab5c8 reduce httpd close debug spew
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 12:56:35 +08:00
Andy Green
63b3b959fc cmake fix install path
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 12:56:35 +08:00
Alex Rhatushnyak
9f2246eb35 correct example lws_write in header
Signed-off-by: Alex Rhatyshnyak <a.rhatushnyak@klervi.com>
2013-03-09 12:01:47 +08:00
Andy Green
38c570c6d2 dont leak when protocol agreement probs
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 11:52:18 +08:00
Henrik Abelsson
2bdbe7a969 Fix printf format error
Signed-off-by: Henrik Abelsson <henrik@abelsson.com>
2013-03-09 09:27:49 +08:00
Andy Green
a83349414f cmake win32 change helper includes to HDR_PUBLIC so they install
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:16:41 +08:00
Andy Green
646c98ab42 dont sweat unkknown method for client
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:09:55 +08:00
Andy Green
5a4f3ae7d0 POLLOUT during wait for server response not an error
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-03-09 09:09:46 +08:00
Arokux B
47f5fa4983 fix win32helpers gettimeofday epoch
Signed-off-by: Arokux B <arokux@gmail.com>
2013-03-05 08:41:47 +08:00
Andy Green
1bc12f9e99 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>
2013-02-28 17:11:29 +08:00
Arokux B
897fec3a89 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>
2013-02-28 09:25:02 +08:00
Andy Green
fc90f698b3 normalize formatting in gettimeofday
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-02-28 09:22:38 +08:00
Arokux B
e5ae9a95fb 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>
2013-02-28 09:18:38 +08:00
Andy Green
975423c949 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>
2013-02-26 11:58:45 +08:00
Luc
e46043cb8c fix mime type on leaf header
Signed-off-by: Luc <luc@honk-honk.com>
2013-02-23 11:01:21 +08:00
Andy Green
fc7c5e4539 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>
2013-02-23 10:50:10 +08:00