Commit graph

2010 commits

Author SHA1 Message Date
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
wonder-mice
f1b125442b Subject: [PATCH] Multiple changes in the build process
* Default CMAKE_BUILD_TYPE to Release
* Use CMAKE_BUILD_TYPE to define _DEBUG (NDEBUG is more standard though,
  but cmake defines it)
* Drop LWS_WITHOUT_DEBUG (use CMAKE_BUILD_TYPE for that)
* Drop LWS_NO_EXTERNAL_POLL (was not used)
* Drop CMAKE_BUILD (CMake is the only build system now)
* Add LWS_WITH_STATIC and LWS_WITH_SHARED to choose what version(s) to
  build
* Add LWS_XXX_LIBRARIES and LWS_XXX_INCLUDE_DIRS for each library
  dependency (zlib, openssl, libev, cyassl)
* Support setting of XXX_LIBRARIES, XXX_LIBRARIES and XXX_INCLUDE_DIRS
  by parent project (when included with add_subdirectory())
* Rename LWS_USE_EXTERNAL_ZLIB to LWS_USE_BUNDLED_ZLIB and default it to
  NO (since it's Windows only)
* Default LWS_WITHOUT_DAEMONIZE to NO (since network lib shouldn't know
  how to do it anyway)
* Rename config.h.cmake to lws_config.h.in
* Rename shared library to websockets_shared so linker will not be
  confused
* Fix inline keyword detection in clang
* Explicitly set MACOSX_RPATH to YES on MacOS
2015-04-24 07:27:18 +08:00
wonder-mice
644fea11c5 Subject: [PATCH] Fix unused n variable warning in http2.c 2015-04-24 07:25:51 +08:00
wonder-mice
0c5aa2f484 Subject: [PATCH] Add missing lib/header.c file
File was lost during merge to upstream.
2015-04-24 07:22:52 +08:00
wonder-mice
67e246fce9 Subject: [PATCH] Be quite when executing openssl commands 2015-04-23 06:13:05 +08:00
wonder-mice
41802c7a98 From 04da2ccd1e8c5b582c4e2a77ee53f929ae8f22a0 Mon Sep 17 00:00:00 2001
Subject: [PATCH] Always include lws_config.h since now we have only CMake
 build
2015-04-23 06:10:51 +08:00
wonder-mice
bd2a6c6477 Subject: [PATCH] Fix broken libev support in client mode 2015-04-23 06:06:10 +08:00
wonder-mice
dd32c24df6 refactor allow http parse also for client 2015-04-23 05:37:46 +08:00
Joakim Soderberg
78dcaf45c4 Subject: [PATCH] Don't fail on non-existing files 2015-04-22 16:26:32 +08:00
Joakim Soderberg
2efac178b8 Subject: [PATCH] Don't build installer on noserver build.
Building the installer like this is a bad idea... Better to move it into
the CMakeLists.txt and be aware of what is being build and so on using
CPack.
2015-04-22 16:19:18 +08:00
=?UTF-8?q?Joakim=20S=C3=B6derberg?=
edcef320e5 Subject: [PATCH] Fix windows build
New version of OpenSSL
2015-04-22 16:16:11 +08:00
Joe Kilner
ba8a2f095c Ensure proper cleanup is performed if last websocket is
closed.
2015-04-22 15:57:17 +08:00
Pokrovskiy
20636ec970 Fix broken libev support in client mode
Maybe it will be better to move all lws_libev_io() inside
lws_change_pollfd() to avoid similar problems in future.
The same for lws_libev_accept() and insert_wsi_socket_into_fds().
2015-04-22 07:50:44 +08:00
Andy Green
40d5abc2aa close reply must use writable control reply path
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-17 20:29:58 +08:00
Andy Green
bb90f9b7e6 client error on timeout before connection
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-16 19:55:42 +08:00
Andy Green
d3efcd9461 windows check for NULL getprotobyname
From maxkaro on trac #110
https://libwebsockets.org/trac/libwebsockets/ticket/110

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-16 04:24:38 +08:00
Andy Green
408f537975 timeout counts as pernmanently unusable close
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-12 08:17:26 +08:00
Danomi Czaski
7fb366a9ef client getaddrinfo valgrind fix
Signed-off-by: Danomi Czaski <djczaski@gmail.com>
2015-04-11 07:00:51 +08:00
brobits
b03820dc0b changed expected shared lib version from 4.0.0 to 5 in spec file 2015-04-08 08:40:16 +08:00
Andy Green
8fb338f71c parser restrict unknown header paranoia to server methods
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-07 08:19:30 +08:00
Andy Green
15ac07f1a0 test echo put proper origin
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-07 07:52:23 +08:00