You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(webdav): enable the server + harden the request path against crashes
Compile WEBDAV_ENABLE back in (SD card mounts as a network drive on
http://<ip>:81/) and fix the crash/robustness issues an adversarial
review of the single-threaded server surfaced. Empirical fuzzing on the
dev unit could not crash the current code, so these are the verified-real
latent bugs, hardened defensively (the box has only ~53 KB internal heap,
where an OOM reboots):
- Chunked request bodies (macOS Finder sends Transfer-Encoding: chunked
on PROPFIND/LOCK/PROPPATCH) were never consumed, so client.stop()
closed the socket with the body unread -> TCP RST truncated our reply
-> Finder retried in a loop. All body-bearing methods now drain a
chunked body before responding. Verified: 60 back-to-back chunked
PROPFINDs now all return a clean 207 with the heap flat.
- Cross-task enable/disable race: Enable/Disable/Exit are called from the
web, MQTT, command and shutdown paths. A start racing the previous
task's self-teardown (delete webdavServer) could new the server against
the concurrent delete -> use-after-free/double-free reboot. The
start/stop decision is now atomic behind a portMUX. Verified: 15x rapid
enable/disable leaves the server up with the heap flat.
- Unbounded header/request-line String growth could exhaust the internal
heap (a header with no newline, or a header flood). Request line capped
at 2 KB (414), total headers at 8 KB / 1 KB per line (431).
- Webdav_Exit only waited 1500 ms, letting the task outlive teardown and
dereference a WiFi stack being shut down; the GET/PUT loops now watch
webdavShouldRun and bail out fast, and Exit waits up to 9 s for a clean
stop.
- PUT with a negative Content-Length returned success on a file already
truncated to empty (data loss); now rejected with 400.
Verified on the dev unit: PROPFIND/OPTIONS/GET still work, and browsing
the share (PROPFIND + GET) while an audiobook plays costs +0.7 s drift
with no crash. No serial panics across all stress runs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/settings.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@
38
38
#defineMDNS_ENABLE// When enabled, you don't have to handle with ESPuino's IP-address. If hostname is set to "ESPuino", you can reach it via ESPuino.local
39
39
#defineMQTT_ENABLE// Make sure to configure mqtt-server and (optionally) username+pwd
40
40
#defineFTP_ENABLE// Enables FTP-server; DON'T FORGET TO ACTIVATE AFTER BOOT BY PRESSING PAUSE + NEXT-BUTTONS (IN PARALLEL)!
41
-
//#define WEBDAV_ENABLE // WebDAV-server (mount the SD card as a network drive on http://<ip>:81/). Disabled: macOS Finder doesn't browse it reliably with the current single-threaded server (needs proper HTTP keep-alive / concurrent connections).
41
+
#defineWEBDAV_ENABLE// WebDAV-server (mount the SD card as a network drive on http://<ip>:81/)
42
42
#defineHOMEKIT_ENABLE// Apple HomeKit (control + Siri + Television) via HomeSpan. Pairs over the existing WiFi; poll task pinned to core 0
43
43
#defineNEOPIXEL_ENABLE// Don't forget configuration of NUM_LEDS if enabled
44
44
//#define NEOPIXEL_REVERSE_ROTATION // Some Neopixels are adressed/soldered counter-clockwise. This can be configured here.
0 commit comments