Commit graph

1579 commits

Author SHA1 Message Date
Andy Green
da49e47daa LICENSE: clarify exceptions also apply to LGPL self-refernences
via Mike Atamas, Counsel for Epic Games
2017-05-19 10:49:02 +08:00
Silas Parker
3b58cc4617 fix close packet index coding
https://github.com/warmcat/libwebsockets/issues/792
2017-02-14 23:26:43 +08:00
Andy Green
249b2d049b client: protect against possible NULL deref path 2017-01-04 14:38:39 +08:00
Namowen
09d8720034 echo: fix debug build
https://github.com/warmcat/libwebsockets/issues/716#issuecomment-267377856
2016-12-16 07:06:33 +08:00
Andy Green
72d78ed4f8 test-client: fix broken protocol names 2016-12-15 13:34:06 +08:00
Andy Green
31d2a2c6dd client: avoid possible NULL deref on error path
https://github.com/warmcat/libwebsockets/issues/672
2016-12-12 20:41:05 +08:00
Andy Green
386365d4bb ws-server: restrict returned Sec-Websocket-Protocol to the chosen name only
https://libwebsockets.org/pipermail/libwebsockets/2016-November/002948.html
2016-11-29 20:42:29 +08:00
Andy Green
bfffba9e09 client: protect againt losing ah by lws_client_connect_2 2016-11-15 17:01:19 +08:00
Peter Pentchev
fa7acb3b88 Remove the cleanup functions with OpenSSL 1.1. 2016-11-03 05:23:53 +08:00
Andy Green
821a97ac66 travis: explicitly point to openssl on osx
One day this started failing at CMake autofind. This forces it to look at the right place.
2016-10-08 20:15:13 +08:00
Andy Green
98fd8e626f docs: explain lws_write handling of truncated sends better 2016-10-08 18:12:49 +08:00
Andy Green
0650cd0fe7 windows: fix snprintf vs _snprintf 2016-09-27 06:55:58 +08:00
Andy Green
8d8e9bec9b appveyor: get nsis from libwebsockets.org 2016-09-27 06:47:33 +08:00
Andy Green
6ed189965f appveyor: get windows openssl from libwebsockets.org 2016-09-27 06:44:20 +08:00
Andy Green
50b9259cb2 travis: update to trusty for CMake version 2016-09-27 06:42:10 +08:00
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
151aa809a6 lws_snprintf
Thanks to Fabrice Gilot for reporting the problem that led to uncovering this.

Due to a misunderstanding of the return value of snprintf (it is not truncated according
to the max size passed in) in places relying on snprintf to truncate the length
overflows are possible.

This patch wraps snprintf with a new lws_snprintf() which does truncate its length to allow
the buffer limiting scheme to work properly.

All users should update with these fixes.

In 1.7.x, there's no affected code in the library itself, just a couple on instances in the
test app code.
2016-09-15 02:36:22 +08:00
Gadkari Mugdha
8d4c673d02 fix for https connection code 2016-06-13 17:19:55 +08:00
Andy Green
499954a096 client CONNECTION_ERROR also allow in LWSS_CLIENT_UNCONNECTED
Signed-off-by: Andy Green <andy@warmcat.com>
2016-06-07 20:12:10 +08:00
Sterling Jensen
e4ea29bd51 Fix leak caused by undestroyed pthread mutex 2016-05-13 09:43:12 +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
60d656fb0f check oom on lws_malloc
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-12 21:54:29 +08:00
Andy Green
5cd457626a appveyor openssl 1.0.2h
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-07 09:39:15 +08:00
Andy Green
9a90ed20ac fix %3d handling in path part and add attack.sh
https://github.com/warmcat/libwebsockets/issues/518

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-07 08:33:07 +08:00
Andy Green
d2feeee1d6 recv revert treating zero as hangup
While checking with ab, I found
commit 30cdb3ac8f
Author: Justin Chen <justinchen00@github.invalid.com>
Date:   Thu Apr 14 21:40:53 2016 +0800

    recv treat zero return as error

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

turned ab performance to crap, reverting it made everything fast again.

recv manpage says there is three ways to get zero returned

1)       When a stream socket peer has performed an orderly shutdown, the return value will be 0  (the  traditional  "end-of-file"
       return).

2)       Datagram  sockets  in  various  domains  (e.g., the UNIX and Internet domains) permit zero-length datagrams.  When such a
       datagram is received, the return value is 0.

3)       The value 0 may also be returned if the requested number of bytes to receive from a stream socket was 0.

we can't just assume it means the peer shut down.

If the peer shut down, then the event loop should get an event on the socket like POLLHUP and deal with it that way.

So the patch mentioned above is simply reverted here.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-05 09:23:05 +08:00
Andy Green
f89e90f6a2 client provide user_space on LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER
https://github.com/warmcat/libwebsockets/issues/509

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-03 21:41:24 +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
381cbf2dc1 client fix reaction to tls failure
https://github.com/warmcat/libwebsockets/issues/508

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-03 08:08:32 +08:00
Patrick Farrell
c6e497ea48 Add warn_unused_result check, attribute only supported by GCC 3.4 or later
warn_unused_result was introduced in GCC version 3.4.

Change-Id: I6c2cc938d2b868ddfe0889cc41d7fa9d70e1b907
2016-04-30 02:08:11 +08:00
Alexander Bruines
96487167dd Android needs sys/resource.h 2016-04-23 17:19: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
659fefe330 cruft remove sigusr2 handling
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-22 21:58:38 +08:00
Andy Green
12df0f0acd client account for retries
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-22 12:40:44 +08:00
hgrundy
461a9068f5 Update libwebsockets.h
Fix for FreeBSD
2016-04-21 17:52:39 +08:00
Justin Chen
edb92ee3c7 recv treat zero return as error
https://github.com/warmcat/libwebsockets/issues/475
2016-04-14 21:42:11 +08:00
Meir Yanovich
c06ea5c7d7 windows snprintf is _snprintf
https://github.com/warmcat/libwebsockets/issues/411#issuecomment-207290650
2016-04-08 16:07:46 +08:00
Galen Ma
1458e7079c android fix rlimit
https://github.com/warmcat/libwebsockets/issues/488
2016-04-08 16:04:58 +08:00
Andy Green
82753d8db6 urldecode forbid malformed
And update attack.sh to confirm the new test cases

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-07 18:57:28 +08:00
Andy Green
3564e3d5e9 libuv add idle processing to force service where needed
https://github.com/warmcat/libwebsockets/issues/485

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-07 18:56:40 +08:00
Andy Green
101bd4272a lws_service_adjust_timeout optimize
Make it exit quicker if something is pending

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-07 18:56:40 +08:00
Andy Green
9ec343d795 revert 622d9f2 ssl pending handcrank
https://github.com/warmcat/libwebsockets/issues/483

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-05 19:51:55 +08:00
Meir Yanovich
900204e3af win32 libuv build notes 2016-04-05 19:51:43 +08:00
Meir Yanovich
ec81fd460b win32 needs strange strftime args 2016-04-05 19:51:25 +08:00
Meir Yanovich
b1f80eeeb7 libuv win32 fixes 2
https://github.com/warmcat/libwebsockets/issues/411#issuecomment-204284368
2016-04-05 07:31:16 +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
8b83266301 uri processing reject paths not starting with slash
https://github.com/warmcat/libwebsockets/issues/481

Return 403 Forbidden if we don't end up with a uri path starting with /

Test server already did this, but this makes it built into the
library.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-02 08:03:48 +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
8cd06ca315 test server align rxbuf with permessage deflate rx buf size
Add a test html button that will send 9KB of junk to confirm it

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

permessage-deflate now checks the protocol rx buffer size for being
>=128, if not, permessage-deflate is disabled on that connection.

If it is >=128 but less than the zlib decompress buffer size, the
zlib decompress buffer size for that connection is reduced to the
nearest power of two of the protocol rx buf size.

To test this, dumb_increment is left violating the >= 128 rx buffer
size and permessage-deflte can be seen to be disabled on his
connections in the test html.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-01 09:30:09 +08:00