Commit graph

1880 commits

Author SHA1 Message Date
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
ABruines
cb2ca08f5d Update http-link to wolfSSL in README.build.md 2015-10-12 08:16:13 +08:00
Alexander Bruines
c3bcb89d01 Move from CyaSSL to wolfSSL
This patch lets libwebsockets use the lastest version of wolfSSL (the new name for CyaSSL).
The reason for the patch is that allthough wolfSSL provides compatibility headers for (old) projects using CyaSSL,
these are incomplete and do not work for libwebsockets.

The patch also fixes a typo in CMakeLists.txt where CYASSL_LIBRARIES was added to include_directories() instead of CYASSL_INCLUDE_DIRS.

Signed-off-by: ABruines <alexander.bruines@gmail.com>
2015-10-12 08:14:50 +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
MGadkari
020c53c8cc Pass HTTP reject error code returned by server to client
AG: added changelog and documentation comment

Signed-off-by: Gadkari Mugdha <mugdha.gadkari@siemens.com>
Reviewed-by: Roger Meier <r.meier@siemens.com>

HTTP reject error code returned by server during HTTP handshake is extracted and sent to the client application.
With this fix, the Connection error callback will include the HTTP reject status code and response frame received from server. This string passed in Connection error callback can be read or ignored by client application based on client application requirement
2015-10-12 07:51:34 +08:00
Frugality
92b69635dd Fixing occasional failure of connect() on Windows
See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspx

Specifically the section reading:

"Until the connection attempt completes on a nonblocking socket, all subsequent calls to connect on the same socket will fail with the error code WSAEALREADY, and WSAEISCONN when the connection completes successfully. Due to ambiguities in version 1.1 of the Windows Sockets specification, error codes returned from connect while a connection is already pending may vary among implementations. As a result, it is not recommended that applications use multiple calls to connect to detect connection completion. If they do, they must be prepared to handle WSAEINVAL and WSAEWOULDBLOCK error values the same way that they handle WSAEALREADY, to assure robust operation."
2015-10-12 07:47:51 +08:00
Andy Green
d211edb85b appveyor update windows openssl blob url
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-11 16:46:33 +08:00
John Tarlton
05fc6bab0d Added callback for PONG responses 2015-10-11 16:25:57 +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
Andy Green
3ae1badae7 cmake remove targets from install path
No package on my machine populates cmake files, I think it's extraneous.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-29 22:40:55 +08:00
Andy Green
26fd0d2603 cmake revert change to linux so
Put back the stanza fixing the .so name to what it has always been
on Linux, trashed in f1b12544

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-29 19:28:37 +08:00
Andy Green
b7a721f803 close CLIENT_WAITING_CONNECT should callback CONNECTION_ERROR
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-27 19:07:38 +08:00
Andy Green
4bca6cd367 close also enable pollout processing for post send close state
This should solve the 100% cpu at close problem reported by Bruce Perens

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-26 06:09:13 +08:00
Andy Green
82eccf7611 close send close ack control packet type
Noticed by Andrey Pokrovskiy

Close processing reused ping processing to save and send the payload,
and sets a flag to know it's close, but forgot to change the control
packet accordingly.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-26 05:32:03 +08:00