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

The example in doc fails. Can this library handle extra 0 (filled by http server) ? #17

Open
pinglanke opened this issue May 22, 2018 · 0 comments

Comments

@pinglanke
Copy link

pinglanke commented May 22, 2018

I wrote this program described in the document(FastCGI Quickstart 10 minute intro): http://cgi.sourceforge.net/docs/fastcgi___cgi/tutorial/fastcgi.html

When I enter 50+1 in the Expression input box,
Std::string str(req.form["expression"]);
Std::cerr << "osx ["<<str<<"] len="<<str.length()<<std::endl;
The length of str is 11. The hexadecimal values are: 35 30 2b 31 0 0 0 0 0 0.
After phrase_parse(iter, end, calc, space, result), the iter is not equal to end.
This extra 0x0 is even written back to the browser, showing garbled characters.
I used tcpdump to capture packet, The extra 0x0 is come from nginx(35 30 25 32 42 31 0 0 0 0 0 0), not browser(35 30 25 32 42 31).
Can the cgi library handle this situation?

@pinglanke pinglanke changed the title The example in "FastCGI Quickstart 10 minute intro" fails. The example in doc fails. Can this library handle extra 0 (filled by http server) ? May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant