1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

70 commits

Author SHA1 Message Date
Andy Green
04f99f1499 lws_retry: udp support 2019-10-10 16:34:37 +01:00
Andy Green
bce1f01370 lws_state and system state
Introduce a generic lws_state object with notification handlers
that may be registered in a chain.

Implement one of those in the context to manage the "system state".

Allow other pieces of lws and user code to register notification
handlers on a context list.  Handlers can object to or take over
responsibility to move forward and retry system state changes if
they know that some dependent action must succeed first.

For example if the system time is invalid, we cannot move on to
a state where anything can do tls until that has been corrected.
2019-09-22 09:35:07 -07:00
Andy Green
f9f6bb66fe lws_validity: unified connection validity tracking
Refactor everything around ping / pong handling in ws and h2, so there
is instead a protocol-independent validity lws_sul tracking how long it
has been since the last exchange that confirms the operation of the
network connection in both directions.

Clean out periodic role callback and replace the last two role users
with discrete lws_sul for each pt.
2019-09-22 09:35:07 -07:00
Andy Green
c591e1adfc asynchronous dns for ipv4 and ipv6
This adds the option to have lws do its own dns resolution on
the event loop, without blocking.  Existing implementations get
the name resolution done by the libc, which is blocking.  In
the case you are opening client connections but need to carefully
manage latency, another connection opening and doing the name
resolution becomes a big problem.

Currently it supports

 - ipv4 / A records
 - ipv6 / AAAA records
 - ipv4-over-ipv6 ::ffff:1.2.3.4 A record promotion for ipv6
 - only one server supported over UDP :53
 - nameserver discovery on linux, windows, freertos

It also has some nice advantages

 - lws-style paranoid response parsing
 - random unique tid generation to increase difficulty of poisoning
 - it's really integrated with the lws event loop, it does not spawn
   threads or use the libc resolver, and of course no blocking at all
 - platform-specific server address capturing (from /etc/resolv.conf
   on linux, windows apis on windows)
 - it has LRU caching
 - piggybacking (multiple requests before the first completes go on
   a list on the first request, not spawn multiple requests)
 - observes TTL in cache
 - TTL and timeout use lws_sul timers on the event loop
 - ipv6 pieces only built if cmake LWS_IPV6 enabled
2019-09-19 06:54:53 +01:00
Andy Green
0fa5563d18 freertos: rename esp32 plat to freertos 2019-08-26 09:58:57 +01:00
Andy Green
c36a1e8ed0 clean: internally use LWS_WITH_CLIENT and _SERVER
Remove some more things in LWS_WITH_SERVER=0 case
2019-08-26 09:58:57 +01:00
Andy Green
d7f0521aeb 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
2019-08-15 10:49:52 +01:00
Andy Green
26319663f7 license: switch LGPLv2.1+SLE parts to MIT 2019-08-14 10:44:38 +01:00
Andy Green
2fc35ef6bd stats: move to pt and improve presentation 2019-08-12 06:18:04 +01:00
Jackson Ming Hu
310bd7d5d4 esp32: use strerror instead of gai_strerror 2019-07-02 08:54:29 +01:00
Chen Xi
892cde2c71 rtos: add support for AMAZON_RTOS 2019-06-05 05:04:17 +01:00
Andy Green
7ca8b77f2c pmd: split ebufs to track in and out 2019-05-06 07:31:32 +01:00
Andy Green
8d473ad78c smtp: make abstract 2019-05-04 08:28:31 +01:00
Andy Green
c13ad5b648 rx flow: use dll2 2019-04-21 19:35:18 +01:00
Andy Green
462847bb6f lws_dll: remove lws_dll_lws and deprecate lws_dll_remove 2019-03-21 06:19:31 +08:00
Andy Green
f8cd973f85 mingw: windows: make minimal examples build 2019-03-10 08:02:02 +08:00
Andy Green
c741f71465 adopt: force incoming fd to nonblocking
Incoming fds muct be nonblocking for any event loop... add a platform
api to do that and call it during adopt.
2019-03-10 08:02:02 +08:00
Andy Green
a57d13cb1b smp: adopt: deal with load balancing init window
With SMP as soon as we add the new sockfd to the fds table, in the
case we load-balanced the fd on to a different pt, service on it
becomes live immediately and concurrently.  This can lead to the
unexpected situation that while we think we're still initing the
new wsi from our thread, it can have lived out its whole life
concurrently from another service thread.

Add a volatile flag to inform the owning pt that if it wants to
service the wsi during this init window, it must wait and retry
next time around the event loop.
2019-03-10 08:02:02 +08:00
Andy Green
419f02ef67 optee: avoid using gai_strerror in udp 2019-02-07 06:22:03 +08:00
Andy Green
84a57540ab LWS_WITH_NETWORK: cmake option for no network code 2019-01-13 07:54:57 +08:00
Renamed from lib/core/adopt.c (Browse further)