111 Commits

Author SHA1 Message Date
Mathieu Carbou 4ece183a5c Prepare move to https://github.com/organizations/ESP32Async 2025-01-20 15:25:05 +01:00
Mathieu Carbou c3584edf81 v3.3.2 2025-01-07 22:09:31 +01:00
Mathieu Carbou 5b9a754c95 v3.3.1 2024-12-16 21:37:52 +01:00
Emil Muratov 611559e59d fix: _remove_events_with_arg() might probably leak mem on queue overflow
it must free message's mem if failed to requeue the pointer
2024-12-17 00:12:46 +09:00
Mathieu Carbou b2f4477d47 v3.3.0 2024-12-15 18:17:42 +01:00
Mathieu Carbou 269124956a Applying clang formatting 2024-12-15 16:51:34 +01:00
Emil Muratov 7bfbb947d0 queue deadlock and congestion aviodance
- do not let `_remove_events_with_arg()` call to block on queue pertubation, otherwise it could deadlock

 - in any case do not block on adding LWIP_TCP_POLL event to the queue, it does not make much sense anyway
   due to poll events are repetitive

 - `_get_async_event()` will discard LWIP_TCP_POLL events when q gets filled up
   this will work in combination with throttling poll events when adding to the queue
   Poor designed apps and multiple parallel connections could flood the queue with interleaved poll events
   that can't be properly throttled or coalesced. So we can discard it in the eviction task after coalescing
   It will work in this way:
    - queue is up to 1/4 full - all events are entering the queue and serviced
    - queue is from 1/4 and up to 3/4 full - new poll events are throttled on enqueue with linear probability
    - queue is from 3/4 up to full top - all new poll events are ignored on enqueue and existing poll events
      already in the queue are discarded on eviction with linear probability giving away priority for all other
      events to be serviced. It is expected that on a new poll timer connection polls could reenter the queue
2024-12-15 17:25:29 +09:00
Emil Muratov 80b2733de5 make _async_service_task's watchdog constantly watching with periodic feed 2024-12-15 10:20:55 +09:00
Emil Muratov afa162b73a Coalesce poll events on queue eviction
Refer: https://github.com/mathieucarbou/ESPAsyncWebServer/discussions/165

Let's try to coalesce two (or more) consecutive poll events into one
this usually happens with poor implemented user-callbacks that are runs too long and makes poll events to stack in the queue
if consecutive user callback for a same connection runs longer that poll time then it will fill the queue with events until it deadlocks.
This is a workaround to mitigate such poor designs and won't let other events/connections to starve the task time.
It won't be effective if user would run multiple simultaneous long running callbacks due to message interleaving.
todo: implement some kind of fair dequeing or (better) simply punish user for a bad designed callbacks by resetting hog connections
2024-12-13 16:32:15 +09:00
Mathieu Carbou 9355538a8f v3.2.15 2024-12-11 19:59:42 +01:00
Mathieu Carbou 31b3452efb Code reformat according to clang file 2024-12-11 19:55:13 +01:00
Mathieu Carbou 8302dba2b8 Issue 169 2024-12-11 15:02:55 +01:00
Emil Muratov ba3fa2a2ca throttle polling events when message queue gets filled up
a proof of concept, might help on long/large responces with user callbacks

(cherry picked from commit 18bbb3318547bde7a34a84229227ea1f5b80cc72)
2024-12-11 11:34:51 +01:00
Mathieu Carbou e48f2a5db8 Fix missing lock/unlock around dns_gethostbyname 2024-12-10 22:44:18 +01:00
Mathieu Carbou f4b81e56ff v3.2.14 2024-11-12 18:45:34 +01:00
Mathieu Carbou d250960259 Fix: Required to lock TCPIP core functionality
See: https://github.com/espressif/arduino-esp32/issues/10526#issuecomment-2471122550
2024-11-12 18:43:58 +01:00
Mathieu Carbou 48a37dedf6 v3.2.12 2024-10-27 08:39:34 +01:00
Mathieu Carbou 45b7ee826b Fix #27: Required to lock TCPIP core functionality 2024-10-27 08:37:58 +01:00
Mathieu Carbou 9e5fd7940d v3.2.11 2024-10-26 12:32:07 +02:00
Mathieu Carbou bad4972734 Fix #27: Required to lock TCPIP core functionality
Ref:
- https://github.com/mathieucarbou/AsyncTCP/issues/27
- https://github.com/espressif/arduino-esp32/issues/10526
2024-10-26 12:30:38 +02:00
Mathieu Carbou e0af59060b v3.2.10 2024-10-13 11:38:27 +02:00
Mathieu Carbou d198248240 Fix _recv method 2024-10-13 11:28:15 +02:00
Mathieu Carbou 784df13d4b Try fix #26 again 2024-10-13 10:05:12 +02:00
Mathieu Carbou c9044bf859 v3.2.9 2024-10-12 20:58:59 +02:00
Mathieu Carbou b4a974dc31 Fix #26 2024-10-12 20:55:11 +02:00
Mathieu Carbou 91f0086735 v3.2.8 2024-10-07 14:31:40 +02:00
Mathieu Carbou 63ff671ac5 v3.2.7 2024-10-07 14:19:04 +02:00
Mathieu Carbou 6631d51e72 v3.2.6 2024-10-03 00:33:26 +02:00
Mathieu Carbou c3f2188901 Rollback #18 2024-10-02 22:57:58 +02:00
Mathieu Carbou 4837967b64 Introduced macro INVALID_CLOSED_SLOT 2024-10-02 22:56:41 +02:00
Mathieu Carbou 5093f8dbcd Changed numbers to enum for _pcb->state 2024-09-09 22:25:40 +02:00
Mathieu Carbou 8fc4aa43b7 v3.2.5 2024-09-03 12:20:41 +02:00
David Woodhouse 95de78acbb Use IPADDR6_INIT() macro to set connecting IPv6 address
If LwIP is built with LWIP_IPV6_SCOPES, there is a 'zone' member in
struct ip6_addr which was not being initialized correctly, leading to
routing failures.

The tcp_connect() call would return ERR_RTE and we would completely fail
to report that error. All the user would see is 'Connecting to MQTT...'
over and over again.
2024-09-02 15:31:44 +02:00
Mathieu Carbou 11f6a803fc v3.2.4 2024-07-29 18:55:48 +02:00
Mathieu Carbou f374fabaa2 Fix link 2024-07-29 18:55:03 +02:00
Mathieu Carbou b20e646658 Try fix #14 2024-07-29 18:55:03 +02:00
Mathieu Carbou 700ad8850d v3.2.3 2024-07-17 21:50:06 +02:00
Mathieu Carbou 018e8ae8b6 Try remove busy loop to fix https://github.com/mathieucarbou/ESPAsyncWebServer/issues/57 2024-07-17 21:42:18 +02:00
Mathieu Carbou 15581b57ec Arduino 3.0.3 compatibility 2024-07-17 15:57:37 +02:00
Mathieu Carbou 76e49649e6 v3.2.1 2024-07-16 23:00:11 +02:00
Mathieu Carbou acdf1f5e71 Revert "Try fix from https://github.com/me-no-dev/AsyncTCP/pull/173/files#r1581612715"
This reverts commit c174f6c467.
2024-07-16 22:54:24 +02:00
Mathieu Carbou 20b139c07c v3.2.0 2024-07-16 22:17:49 +02:00
Mathieu Carbou c174f6c467 Try fix from https://github.com/me-no-dev/AsyncTCP/pull/173/files#r1581612715 2024-07-16 22:16:25 +02:00
Mathieu Carbou f0319ac64e Add fix from https://github.com/me-no-dev/AsyncTCP/pull/184 2024-07-04 12:14:45 +02:00
Mathieu Carbou b20e92e2af v3.1.4 2024-05-30 01:33:45 +02:00
Mathieu Carbou b572c1e969 Fix for https://github.com/mathieucarbou/ESPAsyncWebServer/issues/26 2024-05-30 01:30:32 +02:00
Mathieu Carbou c6c124d382 v3.1.3 2024-05-30 00:35:12 +02:00
Mathieu Carbou b1df6526c1 IPv6 cleanups 2024-05-30 00:34:01 +02:00
Mathieu Carbou 1594d56060 v3.1.2 2024-04-27 14:18:08 +02:00
Mathieu Carbou 212780ced1 Reduce logging of non critical messages 2024-04-27 14:17:23 +02:00