Commit graph

155 commits

Author SHA1 Message Date
Brown, Matthew
1fc082eb7f Added option to build the static library with PIC 2016-09-27 05:36:02 +08:00
Fabrice GILOT
47671fe504 CMakeLists: move config file generation to after LWS_HAVE_OPENSSL_ECDH_H
This is already fixed in v2.0 and master
2016-09-16 09:03:22 +08:00
Andy Green
a085a0ab38 v1.7.9
SONAME to 7.1 because of lws_snprintf()
2016-09-15 02:43:37 +08:00
Andy Green
6d19521b90 v1.7.8
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-12 22:15:15 +08:00
Andy Green
29458b105d v1.7.7
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-03 14:29:07 +08:00
Andy Green
449e73433c v1.7.6
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-23 10:09:33 +08:00
Andy Green
934cc80d95 libuv win32 fixes
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-05 07:31:11 +08:00
Andy Green
e3e89a7241 v1.7.5
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-01 09:45:57 +08:00
Andy Green
674609e69a revert cmake remove targets from install path
Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-29 21:49:47 +08:00
Andy Green
18c328a631 v1.7.4
Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-22 09:19:32 +08:00
Joakim Soderberg
d36fa29ac4 ssl ecdh adapt if missing ecdh.h include
https://github.com/warmcat/libwebsockets/issues/457
2016-03-12 08:49:09 +08:00
Andy Green
dc410bfb78 windows deal with no snprintf
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-03-04 10:58:52 +08:00
Andy Green
7c8ef84848 v1.7.3
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-29 11:30:07 +08:00
Andy Green
34266b7861 v1.7.2
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-25 10:11:01 +08:00
Andy Green
4038721baf test server add lws_status
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 13:44:07 +08:00
Andy Green
9c6bd66859 LWS_BUILD_HASH improve
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-21 13:43:53 +08:00
Andy Green
2209ceb3f5 v1.7.1
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-20 09:20:36 +08:00
Andy Green
9c60ed9d07 v1.7.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-16 13:20:46 +08:00
Andy Green
86ed65ff00 libuv integration
This gets the libuv stuff plumbed in and working.

Currently it's only workable for some service thread, and there
is an isolated valgrind problem left

==28425== 128 bytes in 1 blocks are definitely lost in loss record 3 of 3
==28425==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28425==    by 0x4C2AB1E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28425==    by 0x58BBB27: maybe_resize (core.c:748)
==28425==    by 0x58BBB27: uv__io_start (core.c:787)
==28425==    by 0x58C1B80: uv__signal_loop_once_init (signal.c:225)
==28425==    by 0x58C1B80: uv_signal_init (signal.c:260)
==28425==    by 0x58BF7A6: uv_loop_init (loop.c:66)
==28425==    by 0x4157F5: lws_uv_initloop (libuv.c:89)
==28425==    by 0x405536: main (test-server-libuv.c:284)

libuv wants to sign off on all libuv 'handles' that will close, and
callback to do the close confirmation asynchronously.  The wsi close function
is adapted when libuv is in use to work with libuv accordingly and exit the uv
loop the number of remaining wsi is zero.

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-02-14 09:31:13 +08:00
Andy Green
8c1f6026a7 multithread stability
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-26 20:56:56 +08:00
Andy Green
aa3c8cd371 pthreads only as needed
This just lets you build lws 1.6 without pthreads if your OS / toolchain
makes that possible, in the case you don't build the test apps
(libwebsockets-test-server-pthreads needs it)

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-25 21:39:07 +08:00
Andy Green
d3a5505542 multithreaded service
This adds support for multithreaded service to lws without adding any
threading or locking code in the library.

At context creation time you can request split the service part of the
context into n service domains, which are load-balanced so that the most
idle one gets the next listen socket accept.

There's a single listen socket on one port still.

User code may then spawn n threads doing n service loops / poll()s
simultaneously.  Locking is only required (I think) in the existing
FD lock callbacks already handled by the pthreads server example,
and that locking takes place in user code.  So the library remains
completely agnostic about the threading / locking scheme.

And by default, it's completely compatible with one service thread
so no changes are required by people uninterested in multithreaded
service.

However for people interested in extremely lightweight mass http[s]/
ws[s] service with minimum provisioning, the library can now do
everything out of the box.

To test it, just try

$ libwebsockets-test-server-pthreads -j 8

where -j controls the number of service threads

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-19 20:02:36 +08:00
Andrew Cooks
cdcf5fc9c0 From 7f39ea761e98ea96f79a7e69d4cdeee0c39d316e Mon Sep 17 00:00:00 2001
Subject: [PATCH] fix missing ${LIB_SUFFIX} on cmake config dir
2016-01-18 12:09:43 +08:00
Peter Pentchev
2a0dbcf7ee Generate the API documentation in a reproducible way.
Sort the list of source files before passing them to the kernel-doc
script so that it always outputs the discovered functions and
structures in the same order.
2016-01-18 12:07:07 +08:00
Andy Green
4319b4d78d fuzxy
This is the initial push of a fuzzing proxy we will use for testing lws.

Run libwebsockets-test-fuzxy and the test server if it's local.

Then run the test client with

http_proxy=localhost:8880 libwebsockets-test-client localhost (or whatever)

Right now he only fuzzes one thing but he is operational as a proxy.
2016-01-18 11:16:25 +08:00
David Andrade
ec1296a667 Subject: [PATCH] Make echo test app option consistent with the other test
options
2016-01-15 22:48:17 +08:00
Vijay Khurdiya
e73d446461 ssl add ECDH server support
(AG clean style add option flag and docs)
2016-01-15 16:21:51 +08:00
Andy Green
6711266a50 extension permessage deflate
Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-11 11:34:01 +08:00
Andy Green
40e607b876 test server libev
If we enabled libev support, generate a test server variant that uses it.

Libev has sets its face against fixing its warnings and says -Werror is
"stupid".  So we work around it for the problems their apis cause in
Travis.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-27 09:43:44 +08:00
Andy Green
a24b40860f mbed3 remove forcing _DEBUG
It saves us ~4KB of lwsl_info / _debug etc strings.

The test app comes in at 114KB then, including 19KB of html, png and ico assets.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-26 15:07:45 +08:00
Andy Green
f1cf5bec53 version 1.6.0
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-18 11:19:45 +08:00
Andy Green
11c05bfa09 public api remove superfluous context params API BREAK
Extend the cleanout caused by wsi having a context pointer
into the public api.

There's no point keeping the 1.5 compatibility work,
we have changed the api in several places and
rebuilt wasn't going to be enough a while ago.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-16 18:19:08 +08:00
Roger A. Light
e59908e7fc Subject: [PATCH] Add LWS_LIBRARY_VERSION_NUMBER to lws_config.h.
This changeset adds a few preprocessor macros to lws_config.h to allow
a user of libwebsockets to determine at compile time which version of
lws they are compiling against.

This exposes the already existing LWS_LIBRARY_VERSION_MAJOR and _MINOR
values, and adds LWS_LIBRARY_VERSION_PATCH. This suggests that future
minor bugfix release versions of lws would be e.g. 1.6.0 -> 1.6.1 rather
than the style used previously: 1.2 -> 1.21.

The way this is currently set up means new minor revisions (with
_PATCH==0) always end with .0 but I could change this if preferred.

The most important addition is LWS_LIBRARY_VERSION_NUMBER, which
produces a number of the form 1005001 for version 1.5.1 - i.e. each part
major, minor, patch can extend from 0-999. This macro allows a very easy
compile time comparison of version numbers.
2015-12-15 19:49:55 +08:00
Andy Green
ac19bf6801 soname bump
See

http://ml.libwebsockets.org/pipermail/libwebsockets/2015-December/002052.html

for the reason

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-08 11:06:28 +08:00
Charles Prevot
90a0dd6b75 cmake additionally install cmake config 2015-12-08 10:26:57 +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
Peter Pentchev
bb085dab04 Fix some minor typos. 2015-12-03 22:32:59 +08:00
Andy Green
abc8635824 osx clang blows up if pthreads flag at link time 2
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-29 20:17:49 +08:00
Andy Green
09b8a71b14 osx clang blows up if pthreads flag at link time
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-29 19:41:13 +08:00
Andy Green
1700265081 osx clang quench deprecated api errors
after approach by redhat

https://bugzilla.redhat.com/show_bug.cgi?id=1155181

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-29 19:19:09 +08:00
Andy Green
b39c22fc38 issue 352 clang is like gcc for cmake purposes
After ohauer

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

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-29 18:52:37 +08:00
Andy Green
b7fed3532a test server pthreads
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-20 09:51:42 +08:00
Andy Green
eb15ea0198 refactor test server
Split test-server into four C files and a header

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-19 13:55:47 +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
9ffb42efec cmake force internal SHA1 if no ssl
https://github.com/warmcat/libwebsockets/issues/342

You have to explicitly disable LWS_WITHOUT_BUILTIN_SHA1 Cmake option
alomg with SSL to disable SSL

cmake .. -DLWS_WITH_SSL=OFF -DLWS_WITHOUT_BUILTIN_SHA1=OFF

This makes that implicit with disabling SSL.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-11-09 04:24:46 +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
Andy Green
ab620ffde3 release v1.5
Signed-off-by: Andy Green <andy.green@linaro.org>
2015-10-28 08:39:09 +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
Peter Pentchev
e46f4125ef Fix some typographical and grammatical errors 2015-10-15 11:58: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