Commit graph

1643 commits

Author SHA1 Message Date
Andy Green
d607bb9bfe clean more whitespace 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-06 05:52:09 +08:00
Andy Green
e53f2ed5e6 clean more whitespace
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-05 21:52:41 +08:00
Andy Green
f012c4423c server socket service close fix fail detect
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-05 21:52:16 +08:00
Andy Green
dd6aaa898f windows align lws_service_fd return processing with unix
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-05 09:38:50 +08:00
Andy Green
dc6e47cafc cleanups after api changes and mbed update
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 16:54:12 +08:00
Andy Green
cef609df80 fix Uri Args header name
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:57:48 +08:00
Andy Green
02d60d6d21 api rationalization fix replaces in compatibility defines
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:34:49 +08:00
Andy Green
5c9660da61 clean tidy the worst whitespace alignment probs due to mass token name length changes
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:30:53 +08:00
Andy Green
4b85c1d4ac api rationalization: eliminate all libwebsocket[s]_ prefixes
This nukes all the oldstyle prefixes except in the compatibility code.

struct libwebsockets becomes struct lws too.

The api docs are updated accordingly as are the READMEs that mention
those apis.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 11:08:32 +08:00
Andy Green
6d41720233 api rationalization add cmake switch to export old api wrappers
This is off by default, use

 -D LWS_WITH_OLD_API_WRAPPERS=1

on cmake to get the old api names exported from the library as wrappers
around the new api names.

This allows the library to continue to be compatible with apps that are
not rebuilt with the new libwebsockets.h api compatibility defines.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 10:39:23 +08:00
Andy Green
3ef579b4f9 api rationalization eliminate oldstyle internal api names
Between changing to lws_ a few years ago and the previous two
patches migrating the public apis, there are only a few
internal functions left using libwebsocket_*.

Change those to also use lws_ without regard to compatibility
since they were never visible outside the library.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 09:23:56 +08:00
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
29a44cf2ab api rationalization: introduce public api compatibility defines
Just this is enough to be buildable and allow usage of new defines
for the public api.

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 07:55:17 +08:00
Andy Green
112f9806ac assert.h move to private header
https://github.com/warmcat/libwebsockets/issues/356

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-04 07:22:44 +08:00
Peter Pentchev
bb085dab04 Fix some minor typos. 2015-12-03 22:32:59 +08:00
Andy Green
972eaf91a0 ssl zero return indicates shutdown
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-03 21:37:34 +08:00
Andrew Canaday
622d9f2ff3 Handle pending SSL reads which would otherwise not trigger a POLLIN. 2015-12-03 09:45:18 +08:00
Andrew Canaday
ad2248a207 ssl set ssl to NULL on close 2015-12-03 09:44:15 +08:00
Andrejs Hanins
765914cab1 Allow zero-length pong to be received by server
Client code already allows zero-length pongs
2015-12-01 20:59:52 +08:00
Andrew Canaday
ffe64567da C89 tweaks as per #348. 2015-11-29 19:26:01 +08:00
Andrew Canaday
4cfc42cdaa Terminate truncated header strings. 2015-11-29 19:24:04 +08:00
Andy Green
87eeb0a8bd mbed3 working examples
You need sal-stack-lwip > 1.0.4 with the listen fix

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-25 08:22:08 +08:00
Andy Green
1c6e7bffb7 ssl treat WANT_READ and WRITE separately
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-24 16:54:55 +08:00
Andy Green
ae7b27c77a clean out mbed3 lwip hacks
this upstream mbed patch on sal-stack-lwip sorts the listen probs

a8adf15739.patch

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-24 16:07:18 +08:00
Andy Green
0a05792d8d http post zero content length
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-20 19:31:57 +08:00
Andy Green
c0b0c3d1e2 return AWAITING_TIMEOUT to 5s
Debugging MBED set it to 20 for a few days

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-20 18:52:48 +08:00
Andy Green
5a3b1d307b CALLBACK_LOCK_POLL use len to differentiate locking on pollfd change
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-20 09:51:18 +08:00
Andy Green
9494c66d20 win remove piggybacked hack
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-19 08:43:51 +08:00
Andy Green
f2280d6ce7 proxy auth fix
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-18 19:32:01 +08:00
Andy Green
d55ac45c39 windows eliminate duplicate POLLOUT
After "hotcookie" on github

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-18 09:51:07 +08:00
Andy Green
649f602a18 close actually close after send close ack
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-15 10:28:45 +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
3b19386b10 introduce lws_sockfd_type
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 16:30:37 +08:00
Andy Green
5f2a8155f1 mbed3 build support
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 15:01:37 +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
Andy Green
c53f7cad97 win client use platform invalid socket
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 07:35:27 +08:00
Andy Green
35fef0534b plat win be robust against NULL wsi_from_fd 3
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-14 07:02:38 +08:00
Andy Green
1064cd7619 plat win be robust against NULL wsi_from_fd 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-13 11:43:53 +08:00
Andy Green
46d9b8e06f plat win be robust against NULL wsi_from_fd
After "haitetra"

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-13 10:14:50 +08:00
Andy Green
6e405565f5 proxy auth
Simplifies proxy code to use the existing libwebsocket_set_proxy.

Enables libwebsocket_set_proxy() to parse username:password@ at front of
servername in both http_proxy and info->http_proxy_address.

If given the base64 version of the credentials are sent in the CONNECT
header to the proxy.

Port is now taken from info->http_proxy_address server:port syntax, but if
a port is given in the now deprecated info->http_proxy_port (ie, is nonzero)
then it is allowed to be missed out and the info port used instead for
backwards compatibility.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-08 10:15:01 +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
Andy Green
79a3c5d425 non ssl on ssl port zero recv ambiguous
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-06 08:23:05 +08:00
Andy Green
cc64fb535b non ssl on ssl port fixes
As found by 'github user 7'

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-31 06:49:05 +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
Krishnaraj R Bhat
1662c624ef Define getdtablesize() for android
getdtablesize() has been removed from headers since android-21.
Its value was 1024 in previous android api levels
2015-10-28 21:02:31 +05:30
Andy Green
0c8a8541c6 client only one error callback
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-28 19:50:41 +08: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
Andy Green
29ddc84a5c check errno for ssl non ssl
After thomgree

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-22 20:32:55 +08:00