Skip to content

Fixed signed/unsigned comparison warning. #4

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

Merged
merged 1 commit into from
Mar 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ inline int socket_read(socket_t sock, char* ptr, size_t size)
return recv(sock, ptr, size, 0);
}

inline int socket_write(socket_t sock, const char* ptr, size_t size = -1)
inline int socket_write(socket_t sock, const char* ptr, size_t size)
{
if (size == -1) {
size = strlen(ptr);
}
return send(sock, ptr, size, 0);
}

inline int socket_write(socket_t sock, const char* ptr)
{
size_t size = strlen(ptr);
return socket_write(sock, ptr, size);
}

inline bool socket_gets(socket_t sock, char* buf, int bufsiz)
{
// TODO: buffering for better performance
Expand Down