Skip to content

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.

std::string Http::makeRequest(const char *req) {
constexpr auto BUFFER_SIZE = 10000;
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));


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.

2 participants