Commit graph

220 commits

Author SHA1 Message Date
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
Stepan Vondrak
fc6c274596 fix missing parenthesis protection 2015-10-15 21:05:54 +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
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
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
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
ABruines
80a7068ec8 Allow using CyaSSL in stead of wolfSSL 2015-10-12 08:17:55 +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
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
John Tarlton
05fc6bab0d Added callback for PONG responses 2015-10-11 16:25:57 +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
Andy Green
9f02c5dc24 close cover flush stored send with timeout
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-04-01 05:34:18 +08:00
Andy Green
8ec7802935 context destroy just kill wsis
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-03-25 01:53:58 +08:00
Andy Green
ec86b4e6c4 documentation add info http_proxy members
From https://libwebsockets.org/trac/libwebsockets/ticket/104

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-03-11 08:35:15 +08:00
Johan Simonsson
bb87ac82d1 From 03b93ec864c29dfbc41f2adbdf1b639f5403c95f Mon Sep 17 00:00:00 2001
Subject: [PATCH] Added c include

Fixes #220 and #223
2015-02-04 19:35:47 +08:00
Andy Green
7e37d10e47 gethostbyname removal from lws get peer addresses
This replaces gethostbyname in libwebsockets_get_peer_addresses and
in the client handshake path.

There's one left in lws-plat-win but that can be done another time.

Let's see how much damage that did to the cross-platform and option
builds...

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-01-28 21:03:49 +08:00
Quinlan Pfiffer
49f72aa451 Add PATCH, PUT, DELETE methods
AG: rewrite method code to use method arrays
2015-01-26 11:25:13 +08:00
José Luis Millán
080e6ddded fix #220. Add missing include statement for <cstdarg> 2014-12-16 22:13:53 +08:00
Octav Zlatior
cf5189614a Subject: [PATCH] Adds "REQUIRES PRIVATE KEY" callback
In some situations the private key is not directly available via
filesystem (for example, when stored on a smartcard). If this is
the case, the user can set the private key filepath to NULL and
expect this callback reason to set the key directly via openSSL
library calls.
2014-12-16 08:47:37 +08:00
=?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?=
fdde0f0a03 Subject: [PATCH] proxy protocol (version 1) parsing implementation
The proxy line is dumped in the token buffer as any other HTTP header

Adapted by AG to move token id to be last in the parsed list
2014-12-14 12:13:43 +08:00
Neal Horman
b399237fe8 Subject: [PATCH] add user context pointer to the protocol structure 2014-12-13 14:21:30 +08:00
Neal Horman
98e491fdff Subject: [PATCH] add _lws_logv to make loging accessible to other wrappers.
use _lws_logv in _lws_log
2014-12-13 14:18:27 +08:00
Neil Horman
fc98f9a4ca improve c++ compatibility
Adapted by Joakim
2014-12-13 14:15:48 +08:00
Alejandro Mery
cdc9717be1 Subject: [PATCH] Add custom allocator support using the realloc() interface
Signed-off-by: Alejandro Mery <amery@geeks.cl>
2014-12-05 07:25:24 +08:00
Michael Haberler
49d0ce17d5 Subject: [PATCH] serve_http_file: add feature test macro for API change
introduced in 917f43
2014-12-01 21:47:37 +08:00
Andy Green
a3439032db win32 does not know uint64_t without stdint.h
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-30 13:17:35 +08:00
Andy Green
97ee57fa35 http2 window update
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-11-02 06:54:09 +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
joseph.urciuoli
4d9c8fc01a ssl allow externally managed SSL_CTX
Signed-off-by: joseph.urciuoli <trac90@UNKNOWN.org>
2014-10-16 08:53:19 +08:00
Andy Green
917f43ab82 http2 able to send test.html to nghttp2
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-12 14:31:47 +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
ecc2e72ca1 http2 add hpack decode support
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-10-10 06:15:02 +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
1ee42a5f05 add http2 settings token
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:27:29 +08:00
Andy Green
9887bdb438 test server correct header naming order
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-09-30 08:23:06 +08:00
Andy Green
14425eae4e introduce lws_partial_buffered
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-18 22:49:39 +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
b128ccccca add lws_is_ssl api
Suggested by Michael Harbler on the mailing list

Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-16 09:54:27 +08:00
Michael Haberler
a2d3bf1e4d api: add feature test macro LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD 2014-08-11 20:49:16 +08:00
Andy Green
eabed8defe protocol struct add user controlled id member
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-11 12:11:36 +08:00
Andy Green
a40760a2de no protocol usage inprove docs
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-08-07 16:52:15 +08:00
Andy Green
67f94599d2 trac82 consistently use CONTEXT_PORT_NO_LISTEN
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-31 09:44:00 +08:00
Oleh
faeac3c419 ssl allow passing cert passphrase
https://github.com/warmcat/libwebsockets/issues/152
2014-07-29 23:18:41 +08:00
Andy Green
f55b2eff0a add runtime context flag to enforce defeat of OS CA CERTS even if build option selected
Signed-off-by: Andy Green <andy.green@linaro.org>
2014-07-06 09:36:44 +08:00
Andrew Canaday
da55fb5208 Added HTTP OPTIONS support:
- added options to minilex.c
     - regenerated lextable.h
     - added WSI_TOKEN_OPTIONS_URI to libwebsockets.h
     - tweaked parsers.c to accommodate OPTIONS token
     - tweaked server.c to set uri_ptr and uri_len for HTTP callback on OPTIONS as well
2014-07-06 09:36:43 +08:00
Andrew Canaday
3d2ebf3cd7 Added docs for token limits. 2014-07-06 09:33:40 +08:00
Andrew Canaday
74b4a65745 Added optional per-header length limits:
- libwebsockets.h:
 - * added struct lws_token_limits
   * added token limits pointer to lws_context_creation_info
 - private-libwebsockets.h: added token limits pointer to lws_context_creation_info
 - context.c: copy token limits in create_context
 - client.c / server.c: pass context when invoking libwebsocket_parse
 - parsers.c:
 - * libwebsocket_parse takes context pointer
   * issue_char takes context pointer and checks header length against context limits, if defined
   * issue_char returns 1 (not -1/0) for header too long, and spill: sets the state to WSI_TOKEN_SKIPPING
2014-07-06 09:33:40 +08:00
Andrew Canaday
b57e7a0e2e Added HTTP_STATUS_NO_CONTENT == 204 2014-07-06 09:33:40 +08:00