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

My recs #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

My recs #1

wants to merge 10 commits into from

Conversation

ryanhaining
Copy link

@ryanhaining ryanhaining commented Sep 27, 2016

Good job dudes.
This is mostly academic or "modernizing" stuff. Only the change in http.cpp fixes an actual problem. Bringing down the makefile is pretty good to know too, IMO, but for anything over small projects I'd recommend learning scons or another system.

send(Http::sck, req, std::string(req).length(), 0);
char* buffer = (char *)malloc(BUFFER_SIZE);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you really were to malloc, the most C++-ish thing here would've been
auto buffer = static_cast<char*>(std::malloc(BUFFER_SIZE));

@@ -35,15 +33,12 @@ void Http::connect(std::string url) {
}

std::string Http::makeRequest(const char *req) {
constexpr auto BUFFER_SIZE = 10000;
send(Http::sck, req, std::string(req).length(), 0);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::string(req).length() should be std::strlen(req) mah b.

@wijagels
Copy link

+1

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

2 participants