mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Merge pull request #4 from cesfahani/bug/signed-unsigned-warning
Fixed signed/unsigned comparison warning.
This commit is contained in:
commit
2c276ed31a
1 changed files with 7 additions and 4 deletions
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
|
||||
|
|
Loading…
Reference in a new issue