openwrt / uhttpd

[MIRROR] Tiny HTTP server
https://git.openwrt.org/?p=project/uhttpd.git;
9 stars 6 forks source link

utils: do not send "no more chunks" on timeouts #2

Open luizluca opened 7 months ago

luizluca commented 7 months ago

When a keep-alive times out, it reuses the last request parameters. If the last finished request was using chunks, the timeout will send a spurious "no more chunks" chunk again.

This patch disables chunks in the request after it has sent a "no more chunks" chunk.

Fixes openwrt/openwrt#14460

luizluca commented 7 months ago

@hauke , @jow- , Could you please take a look at this. It is a small fix.

You can reproduce the error requesting an URL using telnet and waiting until the connection timeouts. It will send a spurious 0 before closing the connection.