-
Notifications
You must be signed in to change notification settings - Fork 665
netutils/thttpd: fix broken cgi and fixup kconfig #3119
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
netutils/thttpd: fix broken cgi and fixup kconfig #3119
Conversation
e5fba51
to
e53907d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @TimJTi :-)
@TimJTi please fix nuttx side:
|
@xiaoxiang781216 Can I do it as a third commit in this PR or do I need to do it via a new PR in the nuttx repo? |
Different repo different commit/pr :-) |
please provide pr to nuttx git, I will merge both patch together. |
@xiaoxiang781216 Please advise if you need me to do anything to sort this as I'm sure it was down to me LOL |
let's see what' happen when the new PR come in. |
@xiaoxiang781216 - what new PR? |
If the new PR doesn't have the build break, your change is fine |
Sorry - I hadn't properly rebased by branch to latest upstream so it had a mix of upstream/master and my own changes that were conflicted. All is good. |
Summary
When trying to enable and use the thttp net utility, it was found that CGI apps didnt send any http responses of data from the CGI app back to the browser client,
Investigation revealed this was due to the net socket being opened with the O_CLOEXEC flag set.
This is the result, I believe, of a PR last year here.
See this issue.
In correcting the issue, some complier warnings were encountered and fixed, along with a Kconfig error and an omission, and the opportunity was taken to improve some help text within Kconfig.
This is why there are two commits in the PR.
Question
The cgi_child app that is spawned closes all open file descriprors except stdin, stdout, stderr and the socket's descriptor, up to a maximum number of file descriptors as set via Kconfig.
See here.
Should the Kconfig option be removed and the function use
OPEN_MAX
instead?Impact
No impact on existing usage of this netutil, other than to allow it work properly now!
Testing
This has been tested as part of my own application development, using a custom SAMA5D27C-D1G processor, with the webserver running via CDC-NCM.