OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by spiccinini - 23.10.2019

FS#2562 - uhttpd script_timeout not working as expected

uhttpd is not honouring script_timeout if the cgi script hangs after writing the response HTTP headers.

Reading the code it seems that this behaviour is intended, I don’t understand why. I am proposing to change this as it is common to write part of the response and then do something and then writing the last part of the response. If that last part hangs or takes too long then uhttpd is not killing it.

I am attaching a patch.

I’ve sent the patch to the mailing list a few days ago but maybe here it is easier to discuss?

spiccinini commented on 23.10.2019 02:36

We have been using this patch in production.

spiccinini commented on 11.11.2019 13:45

To reproduce the issue create the following cgi-sript


echo "Status: 200"
echo "Content-type: text/plain;"

sleep 123

and configure script_timeout to 5.
Call this script through http and you will see that uhttpd is not timeouting the script at 5s, the request will finish in 123s when the script finishes.


Available keyboard shortcuts


Task Details

Task Editing