platform/upstream/libwebsockets.git
4 months agoFix Require in libwebsockets.pc 32/302032/2 tizen
cheoleun moon [Thu, 30 Nov 2023 01:40:10 +0000 (10:40 +0900)]
Fix Require in libwebsockets.pc

Change-Id: Ie0835431ecf0311518db77b40e6a3ac312daaba1
Signed-off-by: cheoleun moon <chleun.moon@samsung.com>
9 months agoMigrate to openssl 3.0 26/296026/2
cheoleun moon [Tue, 18 Jul 2023 11:38:29 +0000 (20:38 +0900)]
Migrate to openssl 3.0

Change-Id: I3d62a7a1c5ee30d095eee2e2f240e884493ad92a

10 months agoFix build error 89/294189/1 accepted/tizen_8.0_unified accepted/tizen_unified accepted/tizen_unified_dev tizen_8.0 accepted/tizen/8.0/unified/20231005.095137 accepted/tizen/unified/20230616.172356 accepted/tizen/unified/dev/20230726.115355 tizen_8.0_m2_release
Seonah Moon [Wed, 14 Jun 2023 06:17:22 +0000 (15:17 +0900)]
Fix build error

[   67s] /home/abuild/rpmbuild/BUILD/libwebsockets-4.3.2/lib/tls/openssl/openssl-server.c:713:1: error: conflicting types for 'lws_tls_server_abort_connection' due to enum/integer mismatch; have 'int(struct lws *)' [-Werror=enum-int-mismatch]
[   67s]   713 | lws_tls_server_abort_connection(struct lws *wsi)
[   67s]       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Ida1d7215419161b0c2679b6f3e75f555e24a83ab

13 months agoUpgrade to 4.3.2 71/288971/1 accepted/tizen/unified/20230302.131055
cheoleun moon [Mon, 27 Feb 2023 05:37:29 +0000 (14:37 +0900)]
Upgrade to 4.3.2

Change-Id: Ibbe3393d975b90696db8e4796263b84698f3daf6

13 months agoImported Upstream version 4.3.2 59/288959/1 upstream upstream/4.3.2
cheoleun moon [Mon, 27 Feb 2023 03:18:20 +0000 (12:18 +0900)]
Imported Upstream version 4.3.2

Change-Id: I2116066af6e0d095bb4d5f7be34d86b13c137ad2

17 months agoh1: remove assert on unexpected POLLIN state just hangup 39/284639/1 accepted/tizen/unified/20221124.015426
Seonah Moon [Tue, 22 Nov 2022 07:23:18 +0000 (16:23 +0900)]
h1: remove assert on unexpected POLLIN state just hangup

https://github.com/warmcat/libwebsockets/commit/995a7591846f68dc6155d2362ff83c1590dad07b

Change-Id: Ie2835367e066152929a71ad479e56d31e7fe2336

17 months agoh1: deal with WAITING_CONNECT in ops-h1 38/284638/1
Seonah Moon [Tue, 22 Nov 2022 07:22:23 +0000 (16:22 +0900)]
h1: deal with WAITING_CONNECT in ops-h1

We don't normally see events on the wsi in this state, but it is possible
since warmcat.com lwsws asserted on it in WAITING_CONNECT.

Explicitly handle it so we don't blow up.

https://github.com/warmcat/libwebsockets/commit/027fe42ceca78e04beb65d5c926cf6342e65acc8

Change-Id: I519fe91e10e97d140df7d3b65e79e73324535637

2 years agoFix ASAN build error 78/273378/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.061431 accepted/tizen/7.0/unified/hotfix/20221116.111049 accepted/tizen/unified/20220603.141308 submit/tizen/20220405.063948 submit/tizen/20220602.012031 tizen_7.0_m2_release
Seonah Moon [Tue, 5 Apr 2022 06:32:13 +0000 (15:32 +0900)]
Fix ASAN build error

error: 'strncpy' specified bound 108 equals destination size [-Werror=stringop-truncation]
258 |   strncpy(sau.sun_path, ads, sizeof(sau.sun_path));

Change-Id: Idc6af2ac15e88e60e2c25b837f56a0d7b104a917

2 years ago[CVE-2016-9841] Use post-increment only in inffast.c. 46/272046/1 accepted/tizen/unified/20220325.133352 submit/tizen/20220324.105704
Seonah Moon [Mon, 7 Mar 2022 10:28:50 +0000 (19:28 +0900)]
[CVE-2016-9841] Use post-increment only in inffast.c.

An old inffast.c optimization turns out to not be optimal anymore
with modern compilers, and furthermore was not compliant with the
C standard, for which decrementing a pointer before its allocated
memory is undefined. Per the recommendation of a security audit of
the zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, this "optimization" was removed, in order to
avoid the possibility of undefined behavior.

Change-Id: Icb226a05cd35504c8867bb37bbb79f46340f72e8

2 years ago[CVE-2016-9840] Remove offset pointer optimization in inftrees.c. 45/272045/1
Seonah Moon [Mon, 7 Mar 2022 10:17:13 +0000 (19:17 +0900)]
[CVE-2016-9840] Remove offset pointer optimization in inftrees.c.

inftrees.c was subtracting an offset from a pointer to an array,
in order to provide a pointer that allowed indexing starting at
the offset. This is not compliant with the C standard, for which
the behavior of a pointer decremented before its allocated memory
is undefined. Per the recommendation of a security audit of the
zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, this tiny optimization was removed, in order
to avoid the possibility of undefined behavior.

Change-Id: I2477458b9b90049af941c23384001c3de5433b00

2 years agoEnable LWS_HTTP_HEADERS_ALL and EXTENTIONS 65/271265/1 accepted/tizen/unified/20220218.152608 submit/tizen/20220217.103053
Seonah Moon [Thu, 17 Feb 2022 10:27:36 +0000 (19:27 +0900)]
Enable LWS_HTTP_HEADERS_ALL and EXTENTIONS

For backward compatibility, add following definitions.

- LWS_HTTP_HEADERS_ALL=ON
- LWS_WITHOUT_EXTENSIONS=OFF

Change-Id: Iede1f8fb9a8c644283cc7f8718a64638ded829de

2 years agoFix to expose openssl dependency 53/271153/1 submit/tizen/20220216.061933
Seonah Moon [Wed, 16 Feb 2022 05:55:13 +0000 (14:55 +0900)]
Fix to expose openssl dependency

libwebsocket-dev doesn't expose openssl dependency by its .pc files,
even if it is necessary to build properly.
this patch fix them to expose it.

Change-Id: Id3e3a5ea54bf2a083c30605fa6b24c318b9ec125

2 years agoUpgrade to 4.3 stable 63/270663/2 submit/tizen/20220216.034634
Seonah Moon [Mon, 7 Feb 2022 10:43:23 +0000 (19:43 +0900)]
Upgrade to 4.3 stable

Change-Id: Ief09026e9704607f48567d897c2212a6e749915d

2 years agoImported Upstream version 4.3.stable 08/270008/1 upstream/4.3.stable
Seonah Moon [Mon, 24 Jan 2022 06:24:05 +0000 (15:24 +0900)]
Imported Upstream version 4.3.stable

Change-Id: I2d7bc2f1851649e7a568f0aa72d8eec91eb3e4ad

3 years agoMerge tag 'upstream/3.2.3' into tizen 13/253613/4 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20211029.014320 accepted/tizen/unified/20210217.120515 submit/tizen/20210216.094343 submit/tizen_6.5/20211028.163501 tizen_6.5.m2_release
Cheoleun Moon [Tue, 16 Feb 2021 04:48:48 +0000 (13:48 +0900)]
Merge tag 'upstream/3.2.3' into tizen

Change-Id: I538a1ab537c64150323a469f40078bf001a42c33

3 years agoImported Upstream version 3.2.3 25/253625/1 upstream/3.2.3
Cheoleun Moon [Tue, 16 Feb 2021 04:42:09 +0000 (13:42 +0900)]
Imported Upstream version 3.2.3

Change-Id: Ia07e4efa1d1037c5a049a93119e51a22b5a4947d

3 years agoRevert "Imported Upstream version 3.2.3" 16/253616/1
cheoleun moon [Tue, 16 Feb 2021 04:37:54 +0000 (04:37 +0000)]
Revert "Imported Upstream version 3.2.3"

This reverts commit a48d3a5240a5fc603bcce341161133c635d78392.

Change-Id: Ifc7f63dd87e7454ba3d295ca5d69601820832d9d

3 years agoImported Upstream version 3.2.3 11/253611/1
Cheoleun Moon [Tue, 16 Feb 2021 04:11:51 +0000 (13:11 +0900)]
Imported Upstream version 3.2.3

Change-Id: I8336abdf860558c5653b0fa7dcb5fefd9ea1f92b

3 years agospec: remove unused pkgconfig(libsystemd-daemon) build dependency 72/252872/1 accepted/tizen/unified/20210204.134634 submit/tizen/20210203.034225
INSUN PYO [Wed, 3 Feb 2021 03:35:19 +0000 (12:35 +0900)]
spec: remove unused pkgconfig(libsystemd-daemon) build dependency

Change-Id: Ib430ab894454beae36b7007fd843b32d9b79bce0

3 years agoDisable HTTP2 as default 10/245610/1 accepted/tizen/unified/20201028.123924 accepted/tizen/unified/20201102.124445 submit/tizen/20201013.085727 submit/tizen/20201027.034029 submit/tizen/20201028.022204
Seonah Moon [Tue, 13 Oct 2020 06:49:34 +0000 (15:49 +0900)]
Disable HTTP2 as default

Change-Id: I9d5334ab74dde461fd2c1d908570b8764322393b

3 years agoipv6: support interface name for scope lookup 21/235621/2 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.110007 accepted/tizen/6.0/unified/hotfix/20201102.235050 accepted/tizen/6.0/unified/hotfix/20201103.051054 accepted/tizen/unified/20200609.153644 submit/tizen/20200608.091544 submit/tizen_6.0/20201029.205502 submit/tizen_6.0_hotfix/20201102.192902 submit/tizen_6.0_hotfix/20201103.115102 tizen_6.0.m2_release
Seonah Moon [Mon, 8 Jun 2020 06:20:12 +0000 (15:20 +0900)]
ipv6: support interface name for scope lookup

Currently for ipv6, we look up the scope assuming we were given an interface ip for
binding.  But with ipv4, we also support giving an interface name.

Check it against an interface name first and return that if valid.

https://github.com/warmcat/libwebsockets/commit/280584ff8f147832f008b299d0e32fd4273024db

Change-Id: I9bd36dd680a90dce88e8b58547d0922a4f311122

3 years agoEnable IPv6 95/235395/2 submit/tizen/20200604.101817
Seonah Moon [Thu, 4 Jun 2020 07:55:45 +0000 (16:55 +0900)]
Enable IPv6

- Enable IPv6
- Add new option LWS_WITH_SO_BINDTODEVICE
  : If interface is specified, bind() function is used but it always
  makes error INVALID_ARGMENT. To avoid this error, use SO_BINDTODEVICE
  before calling bind() function.

Change-Id: I2a5495444a1f0910697316d1158192d2d3c519ff

3 years agofix improper use of negative value 35/234535/2
Seonah Moon [Wed, 27 May 2020 06:00:25 +0000 (15:00 +0900)]
fix improper use of negative value

https://github.com/warmcat/libwebsockets/commit/bce4d762e5a6b912f5993fcf3c8ccf94a08c88ca

Change-Id: I5eab3a8b58acb23c0339d33109a7614c93e8e93a

4 years agoRemove unnecessary copy_directory while building 29/231029/1 accepted/tizen/unified/20200421.051515 submit/tizen/20200417.030536
Semun Lee [Fri, 17 Apr 2020 00:22:44 +0000 (09:22 +0900)]
Remove unnecessary copy_directory while building

Change-Id: I07a898abb258deb804d0fff971ef43ea173785a6
Signed-off-by: Semun Lee <semun.lee@samsung.com>
4 years agoprivate.h: rename to contain dir 52/229852/1 accepted/tizen/unified/20200407.043313 submit/tizen/20200406.043810
Andy Green [Thu, 15 Aug 2019 09:49:52 +0000 (10:49 +0100)]
private.h: rename to contain dir

Having unique private header names is a requirement of a particular
platform build system it's desirable to work with

https://github.com/warmcat/libwebsockets/commit/d7f0521aeb7e98bbbcdd1ed75df7331cfb11aa36

Change-Id: Ie7ebb3e65f352ee81be0f168c8b1d2226fa6f33a
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
4 years agoFix License in spec 85/227085/2
Cheoleun Moon [Mon, 9 Mar 2020 11:12:12 +0000 (20:12 +0900)]
Fix License in spec

Change-Id: I5bdbb8c552eacfa06cdae578fafb8e4e0ce3bfe0
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
4 years agoUpgrade to 3.2.0 70/220770/3 accepted/tizen/unified/20191226.122959 submit/tizen/20191226.072601
Seonah Moon [Mon, 23 Dec 2019 07:34:53 +0000 (16:34 +0900)]
Upgrade to 3.2.0

Change-Id: Ib1d65635649f07b5a7f96cbe764febc95b570400

4 years agoImported Upstream version 3.2.0 82/220782/2 upstream/3.2.0
Seonah Moon [Mon, 23 Dec 2019 07:27:56 +0000 (16:27 +0900)]
Imported Upstream version 3.2.0

Change-Id: Iaf62cf2451f42473deaaf945f25543ffc3a1209b

4 years agoRevert "Imported Upstream version 3.2" 72/220772/1
seonah moon [Mon, 23 Dec 2019 06:21:38 +0000 (06:21 +0000)]
Revert "Imported Upstream version 3.2"

This reverts commit 9f40b6be3050816502ad408cac6e8678ce0531ca.

Change-Id: I6b89811f277ac78c541181b45a829300b140a30f

4 years agoImported Upstream version 3.2 68/220768/1
Seonah Moon [Mon, 23 Dec 2019 06:00:59 +0000 (15:00 +0900)]
Imported Upstream version 3.2

Change-Id: I6e68f23f86648e0909c254fb279c22f2aa17c192

4 years agoFix to expose openssl dependency 91/212491/2 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix sandbox/wangbiao/rpm_upgrade tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.011842 accepted/tizen/5.5/unified/mobile/hotfix/20201027.074300 accepted/tizen/5.5/unified/wearable/hotfix/20201027.100614 accepted/tizen/unified/20190828.010611 submit/tizen/20190821.073037 submit/tizen/20190826.011117 submit/tizen/20190826.045105 submit/tizen_5.5/20191031.000007 submit/tizen_5.5_mobile_hotfix/20201026.185107 submit/tizen_5.5_wearable_hotfix/20201026.184307 tizen_5.5.m2_release
Wonki Kim [Thu, 22 Aug 2019 05:26:39 +0000 (14:26 +0900)]
Fix to expose openssl dependency

libwebsocket-dev doesn't expose openssl dependency by its .pc files,
even if it is necessary to build properly.
this patch fix them to expose it.

Change-Id: If4e3f3a21759b9e3b23cc26386e428cc4c7d151c

4 years agoRemove unnecessary openssl dependency 09/209309/2 accepted/tizen/unified/20190712.115311 submit/tizen/20190712.003923
Cheoleun Moon [Thu, 4 Jul 2019 23:27:53 +0000 (08:27 +0900)]
Remove unnecessary openssl dependency

Change-Id: I8ad6ee31795eee76d74770248212724bd99da57b
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
5 years agoEnable LWS_WITH_SERVER_STATUS option 76/186976/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.030506 accepted/tizen/unified/20180820.060017 submit/tizen/20180817.045151 submit/tizen/20190930.012936 submit/tizen_5.0/20181101.000007
Seonah Moon [Fri, 17 Aug 2018 04:29:57 +0000 (13:29 +0900)]
Enable LWS_WITH_SERVER_STATUS option

Change-Id: I29f7a3b8b37254c59fda1176ebde7f4c9112edab

6 years agoclose: add LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION allowed to send 30/168430/1 accepted/tizen/unified/20180129.073414 submit/tizen/20180126.083202
Andy Green [Mon, 22 Jan 2018 23:01:21 +0000 (07:01 +0800)]
close: add LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION allowed to send

https://github.com/warmcat/libwebsockets/issues/1159
(cherry picked from commit bd3d8d9de016b1408bee0e6717319e94dc92e048)

Conflicts:
lib/service.c

Change-Id: I298203267526fdf631a6a1660345176c5e8588b8
(cherry picked from commit 354262de94c8c3d9bdd3885ce075c3b81dd7b858)

6 years agouse license macro in the spec file 53/145153/1 accepted/tizen_4.0_unified accepted/tizen/4.0/unified/20171012.191640 accepted/tizen/unified/20170925.150912 submit/tizen/20170821.113607 submit/tizen/20170822.052640 submit/tizen/20170824.070039 submit/tizen/20170911.052117 submit/tizen/20170912.090505 submit/tizen/20170925.043951 submit/tizen/20170925.045029 submit/tizen_4.0/20171012.093443 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release upstream/2.3.0
Dmitry Kovalenko [Mon, 21 Aug 2017 09:47:15 +0000 (12:47 +0300)]
use license macro in the spec file

Change-Id: I6d9e5baae91404d0b53556306e2a04c8f130f291
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
6 years agoAdd packaging code and LICENSE 52/145152/1
Dmitry Kovalenko [Mon, 21 Aug 2017 09:45:16 +0000 (12:45 +0300)]
Add packaging code and LICENSE

Change-Id: I2604b16b08890720673e5042605ddff410d2100a
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
6 years agoRemove win32port 51/145151/1
Dmitry Kovalenko [Mon, 21 Aug 2017 09:33:11 +0000 (12:33 +0300)]
Remove win32port

Change-Id: I6c3e8510e10ab6245998eca5e430b6c6bf4e2911
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
6 years agoSubject: Mismatched lws_zalloc / free
Cory McWilliams [Wed, 16 Aug 2017 20:03:12 +0000 (16:03 -0400)]
Subject: Mismatched lws_zalloc / free

6 years agodocs: swap _all_protocol_vhost cut and paste
Andy Green [Wed, 16 Aug 2017 07:22:33 +0000 (15:22 +0800)]
docs: swap _all_protocol_vhost cut and paste

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

6 years agoah: reuse at end of transaction has no timeout
Andy Green [Tue, 15 Aug 2017 00:05:56 +0000 (08:05 +0800)]
ah: reuse at end of transaction has no timeout

If we complete a transaction but end up keeping the ah, we must force
a timeout on it.  Otherwise a bad bot could keep the socket open and
exhaust the ah pool.

6 years agosend content-type when LWS_WITH_RANGES=OFF
lnmx [Sat, 12 Aug 2017 12:53:58 +0000 (20:53 +0800)]
send content-type when LWS_WITH_RANGES=OFF

https://github.com/warmcat/libwebsockets/pull/987

With the RANGES feature disabled, lws_serve_http_file would
not add the content-type header to the response.

6 years agohandle same vh protocol reinsert
Andy Green [Sat, 12 Aug 2017 12:53:49 +0000 (20:53 +0800)]
handle same vh protocol reinsert

6 years agolwsws: remove no longer extant D option from help string
Andy Green [Tue, 8 Aug 2017 23:43:37 +0000 (07:43 +0800)]
lwsws: remove no longer extant D option from help string

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

6 years agoping test app: avoid FPE when no packets received
Andy Green [Fri, 4 Aug 2017 05:29:20 +0000 (13:29 +0800)]
ping test app: avoid FPE when no packets received

6 years agoclose path: make sure a second time timeout and ssl buffered lists are scrubbed
Andy Green [Fri, 4 Aug 2017 05:27:34 +0000 (13:27 +0800)]
close path: make sure a second time timeout and ssl buffered lists are scrubbed

lws_meta children can have a different close path

6 years agov2.3.0
Andy Green [Fri, 28 Jul 2017 06:13:42 +0000 (14:13 +0800)]
v2.3.0

6 years agocoverity 182069: coverity confused by use of bool as array index
Andy Green [Fri, 28 Jul 2017 06:20:42 +0000 (14:20 +0800)]
coverity 182069: coverity confused by use of bool as array index

6 years agocoverity 182068: 155650: unnecessary check against illegal NULL
Andy Green [Fri, 28 Jul 2017 06:19:24 +0000 (14:19 +0800)]
coverity 182068: 155650: unnecessary check against illegal NULL

6 years agopmd: autobahn fixes
Andy Green [Fri, 28 Jul 2017 05:12:03 +0000 (13:12 +0800)]
pmd: autobahn fixes

6 years agoattack.sh: adapt to changes
Andy Green [Thu, 27 Jul 2017 23:03:17 +0000 (07:03 +0800)]
attack.sh: adapt to changes

6 years agolog: downgrade logging for ah wait
Andy Green [Thu, 27 Jul 2017 23:04:47 +0000 (07:04 +0800)]
log: downgrade logging for ah wait

6 years agocorrect status payload size
Andy Green [Thu, 27 Jul 2017 23:03:57 +0000 (07:03 +0800)]
correct status payload size

6 years agolws_meta: explicitly declare all of lws_protocols members for ESP32
Andy Green [Thu, 27 Jul 2017 00:27:34 +0000 (08:27 +0800)]
lws_meta: explicitly declare all of lws_protocols members for ESP32

6 years agolibevent: update to use static plugins and work with new libevent2
Andy Green [Wed, 26 Jul 2017 23:57:59 +0000 (07:57 +0800)]
libevent: update to use static plugins and work with new libevent2

Plus fix broken indent style

6 years agotest-server-libuv: add lws_meta
Andy Green [Wed, 26 Jul 2017 23:29:56 +0000 (07:29 +0800)]
test-server-libuv: add lws_meta

6 years agodummy handler: LWS_CALLBACK_HTTP_FILE_COMPLETION
Andy Green [Wed, 26 Jul 2017 23:26:00 +0000 (07:26 +0800)]
dummy handler: LWS_CALLBACK_HTTP_FILE_COMPLETION

6 years agoah: allow configurable ah hold timeout
Andy Green [Wed, 26 Jul 2017 03:49:41 +0000 (11:49 +0800)]
ah: allow configurable ah hold timeout

6 years agohttp2: remove cmake option leave code in for now
Andy Green [Tue, 25 Jul 2017 09:36:31 +0000 (17:36 +0800)]
http2: remove cmake option leave code in for now

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

6 years agoclient: ipv6 reject when lws_getaddrinfo46 failed
namowen [Tue, 25 Jul 2017 09:14:37 +0000 (17:14 +0800)]
client: ipv6 reject when lws_getaddrinfo46 failed

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

6 years agoclient-fix-header-stash-leak-on-close-before-success
Andy Green [Fri, 21 Jul 2017 13:49:24 +0000 (21:49 +0800)]
client-fix-header-stash-leak-on-close-before-success

6 years agoclient: fix hdr stash leak
Andy Green [Fri, 21 Jul 2017 12:58:51 +0000 (20:58 +0800)]
client: fix hdr stash leak

6 years agoclient: always set port even if sockfd already created
Andy Green [Fri, 21 Jul 2017 12:35:58 +0000 (20:35 +0800)]
client: always set port even if sockfd already created

6 years agoclient: fix redirect ssl to ssl
Andy Green [Fri, 21 Jul 2017 12:25:32 +0000 (20:25 +0800)]
client: fix redirect ssl to ssl

6 years agourl cleaning: leave // after http[s]: alone
Andy Green [Fri, 21 Jul 2017 12:04:02 +0000 (20:04 +0800)]
url cleaning: leave // after http[s]: alone

6 years agolws_intptr_t: fix ordering
Andy Green [Fri, 21 Jul 2017 11:25:41 +0000 (19:25 +0800)]
lws_intptr_t: fix ordering

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

6 years agotest-server-libuv: also call context_destroy2 when using foreign loop
Andy Green [Fri, 21 Jul 2017 03:09:03 +0000 (11:09 +0800)]
test-server-libuv: also call context_destroy2 when using foreign loop

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

6 years agoappveyor: remove cache
Andy Green [Wed, 19 Jul 2017 07:29:38 +0000 (15:29 +0800)]
appveyor: remove cache

6 years agocoverity-181580: supposedly dead code
Andy Green [Wed, 19 Jul 2017 06:47:30 +0000 (14:47 +0800)]
coverity-181580: supposedly dead code

6 years agocoverity 181577: lejp_conf loop on calling uv_loop_close to keep coverity happy
Andy Green [Wed, 19 Jul 2017 06:28:53 +0000 (14:28 +0800)]
coverity 181577: lejp_conf loop on calling uv_loop_close to keep coverity happy

6 years agocoverity 181573: false positive since lws_is_ssl returns a bool
Andy Green [Wed, 19 Jul 2017 06:27:13 +0000 (14:27 +0800)]
coverity 181573: false positive since lws_is_ssl returns a bool

6 years agocoverity 181576: remove dead code to keep coverity happy
Andy Green [Wed, 19 Jul 2017 06:25:42 +0000 (14:25 +0800)]
coverity 181576: remove dead code to keep coverity happy

6 years agocoverity 181574: confirm uri_ptr non-null before deref
Andy Green [Wed, 19 Jul 2017 06:19:03 +0000 (14:19 +0800)]
coverity 181574: confirm uri_ptr non-null before deref

6 years agocoverity 181579: check result of malloc as intended
Andy Green [Wed, 19 Jul 2017 06:17:39 +0000 (14:17 +0800)]
coverity 181579: check result of malloc as intended

6 years agocoverity 181575: check vhost iface non-null if using via bind_iface
Andy Green [Wed, 19 Jul 2017 06:16:32 +0000 (14:16 +0800)]
coverity 181575: check vhost iface non-null if using via bind_iface

6 years agolws-meta
Andy Green [Tue, 18 Jul 2017 20:39:14 +0000 (04:39 +0800)]
lws-meta

6 years agoclose: make close notification go through writable
Andy Green [Mon, 17 Jul 2017 02:11:17 +0000 (10:11 +0800)]
close: make close notification go through writable

Until now we took the approach if just writing the close notification
broke something, we didn't care because we were closing the connection
anyway.

But with lws_meta, breaking stuff in the parent connection would be a
sticky problem outliving the closing child connection.

So this adds a new wsi state LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION
and makes the send go via the writable callback mechanism.

6 years agolws-vhost-destroy
Andy Green [Sat, 15 Jul 2017 06:37:04 +0000 (14:37 +0800)]
lws-vhost-destroy

Adds a new api lws_vhost_destroy(struct lws_vhost *) which allows dynamic removal of vhosts.

The external api calls two parts of internal helpers that get reused for context destroy.

The second part is called deferred by 5s... this is to ensure that event library objects
composed into structs owned by the vhost all have a chance to complete their close
asynchronously.  That should happen immediately, but it requires us to return to the
event loop first.

The vhost being removed is deleted from the context vhost list by the first part, and does
not block further removals or creation during the delay for the deferred freeing of the
vhost memory.

Part 1:

 - if the vhost owned a listen socket needed by other vhosts listening on same iface + port, the listen
   socket is first handed off to another vhost so it stays alive

 - all wsi still open on the vhost are forcibly closed (including any listen socket still attached)

 - inform all active protocols on the vhost they should destroy themselves

 - remove vhost from context vhost list (can no longer be found by incoming connections)

 - add to a "being destroyed" context list and schedule the second part to be called in 5s

Part 2:

 - remove us from the being destroyed list

 - free all allocations owned by the vhost

 - zero down the vhost and free the vhost itself

In libwebsockets-test-server, you can send it a SIGUSR1 to have it toggle the creation and destruction of
a second vhost on port + 1.

6 years agoclean: fixes for appveyor warnings
Andy Green [Sat, 15 Jul 2017 11:02:04 +0000 (19:02 +0800)]
clean: fixes for appveyor warnings

6 years agoah: enforce waiting list detach
Andy Green [Tue, 18 Jul 2017 20:06:15 +0000 (04:06 +0800)]
ah: enforce waiting list detach

6 years agovalgrind: avoid complaints from plugin loading
Andy Green [Sat, 15 Jul 2017 09:57:14 +0000 (17:57 +0800)]
valgrind: avoid complaints from plugin loading

6 years agoexplicit vhosts: only check context for flag
Andy Green [Tue, 18 Jul 2017 03:15:43 +0000 (11:15 +0800)]
explicit vhosts: only check context for flag

Although the test apps reuse the context info directly and so inherit the
flag state there when creating vhosts, users might generate a fresh info
without the flag for vhost creation.  So just go by what was given at
context creation time.

6 years agoSubject: Eliminated 'unused variable' compiler warning generated with -DLWS_WITH_NO_L...
Jesse Engle [Mon, 17 Jul 2017 04:16:00 +0000 (04:16 +0000)]
Subject: Eliminated 'unused variable' compiler warning generated with -DLWS_WITH_NO_LOGS=ON.

The unused variable was only declared for use in a log macro that's
compiled out with the above compiler switch. I removed the declaration
and casted the variable at each use in the block.

AG: convert to void case reference irrespective of logging enabled.
AG: travis.yml: add -DLWS_WITH_NO_LOGS=ON that also enables lwsws + cgi code

6 years agovalgrind: stop openssl still reachable complaints
Andy Green [Sat, 15 Jul 2017 09:51:32 +0000 (17:51 +0800)]
valgrind: stop openssl still reachable complaints

6 years agovalgrind: fix leak in caps handling
Andy Green [Sat, 15 Jul 2017 09:50:24 +0000 (17:50 +0800)]
valgrind: fix leak in caps handling

6 years agolibuv: add helper for clean valgrind with foreign loop
Andy Green [Sat, 15 Jul 2017 09:48:37 +0000 (17:48 +0800)]
libuv: add helper for clean valgrind with foreign loop

6 years agoesp32: increase dir depth for include bodge
Andy Green [Mon, 10 Jul 2017 10:52:27 +0000 (18:52 +0800)]
esp32: increase dir depth for include bodge

6 years agotest-html: unify ws open function
Andy Green [Mon, 10 Jul 2017 02:03:31 +0000 (10:03 +0800)]
test-html: unify ws open function

6 years agolinkedlist helpers
Andy Green [Sun, 9 Jul 2017 02:11:59 +0000 (10:11 +0800)]
linkedlist helpers

6 years agomirror: multiple mirror contexts by mirror= url arg
Andy Green [Sat, 8 Jul 2017 07:58:40 +0000 (15:58 +0800)]
mirror: multiple mirror contexts by mirror= url arg

By default mirror acts the same as before.

However if you access the test server with a url containing "?mirror=<name>", the session will bind to
a mirror instance private to "?mirror=<name>".  Only sessions that used the same 'mirror=' name can
share the drawings, mirror instances with a different name (including the default "" name) are unaffected.

6 years agotest server: only init ssl when --ssl in use
Andy Green [Sat, 8 Jul 2017 08:02:18 +0000 (16:02 +0800)]
test server: only init ssl when --ssl in use

6 years agoclient: reject init_client_ssl more than once
Andy Green [Sat, 8 Jul 2017 08:01:34 +0000 (16:01 +0800)]
client: reject init_client_ssl more than once

6 years agolws_intptr_t
Andy Green [Fri, 7 Jul 2017 00:32:04 +0000 (08:32 +0800)]
lws_intptr_t

6 years agolws_return_http_status: if not in HTTP/2, restrict to a single write
Andy Green [Thu, 29 Jun 2017 03:26:22 +0000 (11:26 +0800)]
lws_return_http_status: if not in HTTP/2, restrict to a single write

6 years agoparsing: if we ended on a set of headers and read a new buffer mark as more_rx_waitin...
Andy Green [Thu, 29 Jun 2017 02:13:29 +0000 (10:13 +0800)]
parsing: if we ended on a set of headers and read a new buffer mark as more_rx_waiting to avoid dropping the ah

6 years agoclient: use right state machine
Boutoukoat [Wed, 28 Jun 2017 14:25:57 +0000 (22:25 +0800)]
client: use right state machine

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

6 years agofile serve: defer transaction completed to HTTP_FILE_COMPLETION
Andy Green [Wed, 28 Jun 2017 06:27:09 +0000 (14:27 +0800)]
file serve: defer transaction completed to HTTP_FILE_COMPLETION

6 years agoah: require parsing complete before detach
Andy Green [Wed, 28 Jun 2017 04:13:13 +0000 (12:13 +0800)]
ah: require parsing complete before detach

Introduce helpers to force to detachable state and to test the ah is
in a detachable state.

Require not only the ah rx buffer is all used, but that the
wsi has completed a full set of headers.

6 years agotest-server-libev: disable Werror just on server-libev.c to workaround libev dirt
Andy Green [Wed, 28 Jun 2017 03:35:50 +0000 (11:35 +0800)]
test-server-libev: disable Werror just on server-libev.c to workaround libev dirt

6 years agotest-server-libuv: add missing call to lws_context_destroy2()
Andy Green [Wed, 28 Jun 2017 03:21:03 +0000 (11:21 +0800)]
test-server-libuv: add missing call to lws_context_destroy2()

6 years agotest servers: convert to static inclusion of plugins
Andy Green [Wed, 28 Jun 2017 03:16:48 +0000 (11:16 +0800)]
test servers: convert to static inclusion of plugins

This eliminates the duplicated implementations of the test protocols,
except dumb-increment (which requires libuv).

This has various advantages, including bringing all the test servers
up to the same set of protocols support.

Triggered by finding a bug in server status protocol that was long
ago fixed in the plugins version.