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

env.cgi looking for STDIN #73

Open
felixvelariusbos opened this issue Nov 24, 2019 · 1 comment
Open

env.cgi looking for STDIN #73

felixvelariusbos opened this issue Nov 24, 2019 · 1 comment
Labels
Question Need some information Resolved The issue is resolved or got answered

Comments

@felixvelariusbos
Copy link
Contributor

felixvelariusbos commented Nov 24, 2019

It looks like env.cgi has an continuous loop where it waits for STDIN and printing out anything it gets. It will never stop looking for more STDIN. I noticed this when I tried to run it and it started to hang:

while (<STDIN>) {
	print "$_<br>\n";
}

Looking at the RFCs, STDIN is an option to send in data, but we're choosing to use environment variables. In that case, is the goal of this loop being there to, basically, check if the server gracefully get out of it?

@ibnesayeed ibnesayeed added the Question Need some information label Nov 24, 2019
@ibnesayeed
Copy link
Collaborator

We do not send everything using environment variables. The payload in methods like POST and PUT (or any other method that allows entity body) is sent over STDIN. Query parameters, if any, are sent in environment variable, but that is not the only way of sending data to the server. The env.cgi script is written in a way to print every environment variable and any payload data, if present. If your server has nothing to be sent over STDIN, it can send None or empty bytes on it when executing the script process.

@ibnesayeed ibnesayeed added the Resolved The issue is resolved or got answered label Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Need some information Resolved The issue is resolved or got answered
Projects
None yet
Development

No branches or pull requests

2 participants