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

Make getHTTPRequest() at least somewhat sane #48

Merged
merged 1 commit into from Apr 17, 2018
Merged

Make getHTTPRequest() at least somewhat sane #48

merged 1 commit into from Apr 17, 2018

Conversation

niklas88
Copy link
Member

This code really needs replacement with a proper HTTP library but for now at
least fix the most glaring issues, including:

  • Add a TODO to get this removed
  • Don't busy wait with recv(…, MSG_DONTWAIT) for no gain over blocking and 100%
    CPU use
  • Actually extract the headers instead of leaving them empty
  • Just use a string instead of a std::ostringstream and converting back and forth
  • Don't use NULL terminated string APIs when we have nice ones
  • Add some useful comments on what the ifs actually test

This code really needs replacement with a proper HTTP library but for now at
least fix the most glaring issues, including:

- Add a TODO to get this removed
- Don't busy wait with recv(…, MSG_DONTWAIT) for no gain over blocking and 100%
  CPU use
- Actually extract the headers instead of leaving them empty
- Just use a string instead of a std::ostringstream and converting back and forth
- Don't use NULL terminated string APIs when we have nice ones
- Add some useful comments on what the ifs actually test
@niklas88 niklas88 merged commit a8b495b into ad-freiburg:master Apr 17, 2018
@niklas88 niklas88 deleted the network_no_busy_loop branch October 31, 2018 09:35
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

Successfully merging this pull request may close these issues.

None yet

1 participant