mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-04-11 19:28:30 +00:00
Merge pull request #4 from cesfahani/bug/signed-unsigned-warning
Fixed signed/unsigned comparison warning.
This commit is contained in:
11
httplib.h
11
httplib.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user