Commit graph

1193 commits

Author SHA1 Message Date
Joakim Söderberg
a42ac7b1fb Update README.build.md 2015-10-30 00:27:57 +01: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
1b42913808 update appveyor status decal url
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-28 08:55:01 +08:00
Andy Green
ab620ffde3 release v1.5
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-28 08:39:09 +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
Alexander Lukichev
fe6030a62b Make LWS_SEND_BUFFER_PRE_PADDING preprocessor if-friendly
Commit 173e9c4e made LWS_SEND_BUFFER_SIZE a multiple of a certain
value returned by _LWS_PAD_SIZE macro. This macro expanded to
"sizeof(void *)" on non-x86_64 architectures, which made it
unsuitable to use LWS_SEND_BUFFER_SIZE in preprocessor #if
expressions in the library user code.

This patch preserves the padding logic since commit 173e9c4e but
makes it more preprocessor-friendly for applications using
libwebsockets by setting _LWS_PAD_SIZE to the size of "void *"
determined by cmake when libwebsockets is configured for the
target platform.

Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
2015-10-21 12:52:15 +02:00
Andy Green
2721e3ca9d qualify server specific api with LWS_NO_SERVER
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-21 09:23:21 +08:00
Andy Green
2627148523 keepalive fix flow now forced closed removed
Since 0d89f3cbed added recently,
http1.1 keepalive tries to actually keep alive.

Some updates are needed to keepalive flow to solve problems coming from
changes that were hidden until now by keepalive basically closing until
recently.  It's not very noticable since clients will retry as close is
the default 1.0 behaviour... anyway this lets me do

wget http://localhost:7681/test.html http://localhost:7681/test.html

using keepalive correctly on the test server.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-21 08:16:34 +08:00
Andy Green
d256194a0c document context create cannot execute in parallel
Reported by Ash 20001 <ash20001@hotmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-20 12:24:00 +08:00
Ash 20001
0d89f3cbed detect http1 close connection header properly 2015-10-20 12:12:12 +08:00
Andy Green
b5cf69fdb5 correct error handling path in client handshake
After Vikas Gahlan

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-October/001955.html

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-18 18:51:36 +08:00
Joakim Söderberg
74a54e8b94 Ignore cmake build/ directory 2015-10-16 21:07:38 +02:00
Andy Green
dbbd31141a if ssl and non ssl allowed insist to wait for something to discriminate by
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-16 11:39:23 +08:00
Andy Green
2488c46c9b attempt to get correct close flow banning writeable cb when closing
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-16 11:07:52 +08:00
Andy Green
f7e2a85e11 complain if zero ka_interval used with positive ka_time
https://github.com/warmcat/libwebsockets/issues/308

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-16 10:54:04 +08:00
Andrejs Hanins
f94dd2ea3e Fix getaddrinfo memory leak 2015-10-15 21:27:25 +08:00
Mark Likness
dbe624de76 allow EAGAIN and friends on straight read 2015-10-15 21:21:06 +08:00
Stepan Vondrak
fc6c274596 fix missing parenthesis protection 2015-10-15 21:05:54 +08:00
Peter Pentchev
e46f4125ef Fix some typographical and grammatical errors 2015-10-15 11:58:54 +08:00
Peter Pentchev
91fe5aa64f Use bash as a script interpreter
The test-server/attack.sh script makes use of several features only
available in the Bash shell, so mark it accordingly.
2015-10-15 11:47:38 +08:00
Andy Green
4c79ee7598 LWS_WITHOUT_BUILTIN_SHA1
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 11:20:40 +08:00
Andy Green
6d59f59745 LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED
Requested by Bruce Perens

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-June/001834.html

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 09:12:58 +08:00
Andy Green
a739f75ee2 ssl set session id context
Via Bruce Perens

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-June/001833.html

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 09:00:31 +08:00
Bruce Perens
e38b8505b7 remove O3 if cmake debug build 2015-10-15 08:46:29 +08:00
Andy Green
940a75503c avoid changing wrong revents if connection closed
As reported by Bruce Perens

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-May/001814.html

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 08:34:21 +08:00
Andy Green
1963c9aa7f improve callback close checking
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-15 07:39:33 +08:00
Fabian Kurz
f54715bd5f accept http1.1 from proxy 2015-10-14 14:52:28 +08:00
bdavis
353fdc383e fd test will fail under windows, where file descriptors can be large numbers 2015-10-14 10:17:20 +08:00
Bruce Perens
173e9c4ea2 padding align to ptr size
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-13 09:17:39 +08:00
jirihnidek
fdd3f09dd7 add cmake Find for lws 2015-10-13 08:20:41 +08:00
Thomas Greenslade
a2a4b0b084 additional https post fix
https://github.com/warmcat/libwebsockets/pull/298#issuecomment-147316562
2015-10-12 16:06:26 +08:00
Roger A. Light
b9f28ac8df Attempt to fix server problems receiving large https POSTS.
Without this change the pending list ends up having
wsi->pending_read_list_next == wsi, which causes a loop in
lws_plat_unix().
2015-10-12 11:30:37 +08:00
Andrew Canaday
79d09fcc37 WHOOPS! Stuck the sigint init int the wrong function. 2015-10-12 11:19:55 +08:00
Andrew Canaday
6740b70aaf Set default libev-related SIGINT handling at context create
to avoid breaking backwards compatibility with existing deploys.
2015-10-12 11:18:23 +08:00
Andrew Canaday
a8f47c9844 Added libwebsocket_sigint_cfg for libev builds to provide
runtime configuration of sigint behavior.
2015-10-12 11:16:46 +08:00
Marc Aldorasi
89f5eec5ac Pass the correct hostname when using a proxy
The proxy doesn't modify the SNI request, so we need to pass the name of
the host we're trying to reach instead of the proxy we're reaching it
through.
2015-10-12 10:37:49 +08:00
Roger A. Light
7a474b4e2d Separate private defines in lws_config_private.h
So we don't expose all HAVE_ macros and such to the world.
2015-10-12 10:10:20 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
caf7e3d63b Fix potential memory leak
- Got rid of ifdef _WIN32 stuff adn moved to plat_ files instead.
- Also, check all calls to lws_zalloc, was potential failure on WIN32
- Made context destory enable to destroy a half inited context as well. This way I got get rid of some of the error handling complexity in libwebsocket_create_context
- Added TODOs for some potential problems I see where things might be leaking and such
2015-10-12 10:05:18 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
8361d34ff9 Bugfix: SSL code should not free wsi
The SSL code should not do lws_free(new_wsi) here. The caller should clean up the wsi in libwebsocket_close_and_free_session. Instead this can potentially cause a crash during that call.

Also if we fail to create the SSL for hte listener we should indicate failure to the caller.
2015-10-12 10:03:41 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
12f557b21d Turn off building windows installer, breaks everything 2015-10-12 10:02:07 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
a8c9a0e9a3 From 0a0b9a6d02037e93dabadad5e04d39c1c6af0c96 Mon Sep 17 00:00:00 2001
Subject: [PATCH] Update Openssl lib version
2015-10-12 09:57:41 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
4427244b8b Don't mess with system types
is no problem on a unix system with sys/types.h

However on Windows it will result in a #undef pid_t ... When libwebsockets is used with pthreads32 which typedefs pid_t itself, it will fail to build with some weird errors.

Also since we're exporitng these macros to the entire world via libwebsockets.h we should not define a VERSION macro. Which is defined improperly anyway.
2015-10-12 09:55:09 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
cefab311d6 Use LWS_HAVE_ instead of just HAVE_
Since we include lws_config.h in the public headers, at least our HAVE_ macros should be kind of unique, so that we don't get redefinitions when used with other libraries using config files as well.
2015-10-12 09:53:17 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
70c5717a07 Fix windows build errors
NSI installer errors causing failed windows builds
2015-10-12 09:33:44 +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
Roger A. Light
b6147fd2e5 Fix shared library name for all platforms
This is a further fix to f1b1254, building on 26fd0d2.

Tidy up the LWS_WITH_SHARED and LWS_WITH_STATIC options.
2015-10-12 08:27:38 +08:00
ABruines
80a7068ec8 Allow using CyaSSL in stead of wolfSSL 2015-10-12 08:17:55 +08:00