Commit graph

123 commits

Author SHA1 Message Date
Andy Green
6230476455 api rationalization use new names internally
Change all internal uses of rationalized public apis to reflect the
new names.

Theer are a few things that got changed as side effect of search/replace
matches, but these are almost all internal.  I added a compatibility define
for the public enum that got renamed.

Theoretically existing code should not notice the difference from these
two patches.  And new code will find the new names.

https://github.com/warmcat/libwebsockets/issues/357

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 08:43:54 +08:00
Andy Green
11f27345d2 mbed3 workable plus or minus mbed3 net stack bug
https://github.com/ARMmbed/sockets/issues/35

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 16:33:21 +08:00
Andy Green
8c0d3c035c mbed3 plat
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 16:31:59 +08:00
Andy Green
2cd3074746 mbed3 warning cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 16:31:01 +08:00
Andy Green
fc772ccc00 win use platform invalid socket api elsewhere too
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 13:48:58 +08:00
Andrejs Hanins
140ac6e9cb Subject: [PATCH] Fix for close ack sending
It was forgotten in two places that pending close ack should be
processed when wsi state is WSI_STATE_RETURNED_CLOSE_ALREADY, but
not WSI_STATE_ESTABLISHED. As a result, close ack wasn't sent out
to the peer.
2015-11-07 07:04:46 +08:00
Stephan Eberle
b820e2c2cc Implemented fixes allowing libwebsockets to be built under Windows using MinGM/MSYS
Improvemed patches to address travis and appveyor build errors

Reduced WINVER and _WIN32_WINNT to 0x0501 to be less restrictive

Refined CMakeLists.txt to allow for normal Windows and MinGW-specific OpenSSL certificate generation

Simplified include path to gettimeofday.h

Removed unnecessary list(APPEND LWS_LIBRARIES zlib_internal) export

Added back #include <windows.h> to gettimeofday.c to fix build for normal Windows

Made sure that pollfd gets defined on libwebsockets side when _WIN32_WINNT < 0x0600

Made sure that WINVER and _WIN32_WINNT don't get overridden by libwebsockets headers when already set to something greater than 0x0501

Added missing declaration of WSAPoll function for WINVER < 0x0600 in libwebsockets.h, eliminated invalid usages of pollfd instead of libwebsocket_pollfd in test-server.c

Cleaned up duplicate content in gettimeofday.c, removed header inclusions from gettimeofday.h and fixed include order in test-echo.c, test-ping.c and test-server.c to enable build with normal Windows and MinGW

Re-enabled debug_level in test-echo.c and made sure that the call to lws_set_log_level() is also active under Windows (just like in test-server.c); replaced all WIN32 occurrences by _WIN32 in test-echo.c, test-ping.c, and test-server.c

Removed build-msys.sh and added new section about how to build libwebsockets using MinGW to README.build.md
2015-10-30 00:16:40 +01:00
Andy Green
c6f95d3f27 keepalive close file when send completes dont wait for wsi close processing
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-27 07:07:14 +08:00
Mark Likness
dbe624de76 allow EAGAIN and friends on straight read 2015-10-15 21:21:06 +08:00
Andy Green
6f1e8849bd use send MSG_NOSIGNAL
after

810dbadd6b

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-12 08:43:36 +08:00
=?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?=
4c0ba02771 fix #309. Receive large messages over WSS
Read the full incoming TLS/SSL record at once in libwebsocket_service_fd().

SSL_read() is called until no more pending data for the current record is buffered in SSL.
SSL_read() is never requested more than the pending data size for the current record
to ensure that the fd is not read again for new data, which would be copied in the SSL buffer otherwise.
2015-10-12 08:07:38 +08:00
=?UTF-8?q?Dalibor=20Ba=C4=8Da?=
5400f47efe [PATCH] added timeout reset in serve_http_file_fragment to prevent timeout on big files 2015-10-11 16:14:11 +08:00
Alejandro Mery
6ff28248aa Subject: [PATCH] Use custom allocator
Signed-off-by: Alejandro Mery <amery@geeks.cl>
2014-12-05 07:26:26 +08:00
Andy Green
7ef4b2e1f2 coverity 83661 output check lseek return
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:10:26 +08:00
Andy Green
1cea5816fa http2 dont use incoming END_STREAM when sending headers
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-19 07:36:20 +08:00
Andy Green
b0e2e50c75 http2 working nghttp fetch multi files completely
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-18 18:54:04 +08:00
Andy Green
200f385716 http2 track content length add END_STREAM
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-18 12:23:05 +08:00
Andy Green
91b0589795 http2 handle flags
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-17 09:33:16 +08:00
Andy Green
1e49918a4f trac 89 add flag on fatal send fail to use simple close
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-16 08:23:46 +08:00
Andy Green
2add6340d5 http2 hpack basic decode ok including huff
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-12 08:38:16 +08:00
Andy Green
1f5c9f0c31 ssl_capable_read add context param
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-09 08:14:30 +08:00
Andy Green
095d303b49 http2 fix build when http2 disabled
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-08 12:15:29 +08:00
Andy Green
024eb6c80c http2 can keep upgraded connection up
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-08 12:00:53 +08:00
Andy Green
822241c2a7 deprecate no_buffer_all_partials
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-18 22:21:51 +08:00
Andy Green
f4ffc1e215 fixes for close flush
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 17:06:59 +08:00
Andy Green
a1a24d26a6 close should flush any truncated send before really closing
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 14:25:24 +08:00
Andy Green
d7340c141f clean=various ifdef reduction
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 14:08:10 +08:00
Andy Green
15d56dd9da truncated send always callback on writeable
Suggested by a Windows log where leaf.jpg meets EAGAIN and after
issuing the truncated send buffer, never sends any more

https://github.com/warmcat/libwebsockets/issues/111#issuecomment-39873129

Added note in README.coding about WRITEABLE callbacks able to
be generated by lws.

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-10 11:23:18 +08:00
Andy Green
485abc1c66 allow signals during send
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-06 12:41:20 +01:00
Andy Green
02138126f2 refactor add ssl read write single implementation
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-06 06:26:35 +01:00
Andy Green
b49a995a8d clean small additional ifdef reduction
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-03 10:11:04 +08:00
Andy Green
2c24ec0211 refactor out most NO_EXTENSIONS
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 19:45:42 +08:00
Andy Green
158e804cb7 refactor out WIN32 tests from code
This gets rid of all the platform-dependent #ifdef stuff and
migrates it into the new lws-plat-xxx.c files.

These are then included in a one-time test in libwebsockets.c
according basically to Windows or not.

The idea is from now on, all Windows-specific code should go in
lws-plat-win.c, where any kind of Windows perversion like DWORD
is fine.

Any new functions going in there should be named lws_plat_...
and be defined in all the lws-plat-xxx.c file (currently just
win32 and unix platforms are supported).

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-02 14:25:10 +08:00
Andy Green
03cf1dde39 truncated send issue independent of LWS_NO_EXTENSIONS 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-01 14:20:44 +08:00
Andy Green
5bc002e424 only use clean buffer for failed write if sent something
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-04-01 09:59:39 +08:00
Patrick Gansterer
0fc37b64f6 windows Use WSAWaitForMultipleEvents() instead of poll() on Windows 2014-03-29 09:54:40 +08:00
Andy Green
28b12ad0af ssl output handle want read write
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-23 12:02:52 +08:00
Andy Green
e254d9589d truncated send keep and grow truncation buffer
Also change from looking at wsi->truncated_send_malloc to see if we are in the middle of
dealing with a truncated send to looking for nonzero wsi->truncated_send_len

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-23 11:41:15 +08:00
Andy Green
27e770b0ef clean output.c a little
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-03-23 11:21:51 +08:00
Patrick Gansterer
2dbd837c41 WSAGetLastError() instead of errno on Windows
Error codes set by Windows Sockets are not made available through the errno
variable. Checking them via WSAGetLastError() is the corret solution.
2014-02-28 20:08:55 +08:00
Patrick Gansterer
e5720a347e Cleanup include statements
Remove useless includes and add some preprocessor conditions for platform specific headers.
2014-02-28 08:51:35 +08:00
Patrick Gansterer
81338aa886 Use native file functions on Windows
Add a special implementation with CreateFile(), ReadFile() and CloseFile()
for serving HTTP file request to allow compilation on all Windows platforms.
2014-02-27 21:20:36 +08:00
Andy Green
8ea1955c3e fix zero length ping pong
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-02-15 16:00:37 +08:00
Nikolay Dimitrov
a8268e7619 fix dropmask dereference even when NULL
Signed-off-by: Nikolay Dimitrov <ndimitrov@setelis.com>
2013-12-21 10:22:17 +08:00
mroszko
793e7c07d8 NO_EXTENSIONS fixes
Trac #52

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-12-10 21:15:00 +08:00
Andy Green
2764eba89f handle EAGAIN during send
This patch deploys the truncated send work to buffer output in case
either send() or the SSL send return a temporary "unable to send"
condition even though they signalled as writeable.

I added a by-default #if 0 test jig which enforces only half of what
you want to send is sendable, this is working when enabled.

One subtle change is that the pipe reports choked if there is any
pending remaining truncated send.  Otherwise it should be transparent.

Hopefully...

Signed-off-by: Andy Green <andy.green@linaro.org>
2013-12-09 14:16:17 +08:00
Andreas Pakulat
944a78dc58 protect the label with an ifdef
The only part that actually goes to this label is inside such an ifdef,
so building without extension support makes gcc bail out since an unused
label is considered an error in this project.
2013-11-24 14:28:48 +08:00
Andy Green
4e7a13314d real http status codes update attack.sh
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-11-11 07:30:33 +08:00
Andy Green
7900256c8a allow other headers in http send file
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-11-09 11:40:38 +08:00
Andy Green
0c0bf4a985 fix clean return path user code handle
Signed-off-by: Andy Green <andy.green@linaro.org>
2013-10-18 19:23:06 +08:00