Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#2562 - uhttpd script_timeout not working as expected #8225

Closed
openwrt-bot opened this issue Oct 23, 2019 · 3 comments
Closed

FS#2562 - uhttpd script_timeout not working as expected #8225

openwrt-bot opened this issue Oct 23, 2019 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

spiccinini:

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?

@openwrt-bot
Copy link
Author

spiccinini:

We have been using this patch in production.

@openwrt-bot
Copy link
Author

spiccinini:

To reproduce the issue create the following cgi-sript

#!/bin/sh

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.

@openwrt-bot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant