Skip to content

Commit 1063a01

Browse files
authored
Fix infinite loop when requesting too quickly
On the Pico W we can get in an infinite loop if we request pages too quickly. This is because we get an OSError 32 Broken Pipe back from which we can't recover. I've made it so any of the unexpected errors will be re-raised. Fixes this issue: #44
1 parent c1a47ab commit 1063a01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_httpserver/response.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,5 +245,7 @@ def _send_bytes(
245245
except OSError as exc:
246246
if exc.errno == EAGAIN:
247247
continue
248-
if exc.errno == ECONNRESET:
248+
elif exc.errno == ECONNRESET:
249249
return
250+
else:
251+
raise exc

0 commit comments

Comments
 (0)