Commit a40597c3 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

sres.c: fixed definition of sres_send() and sres_recvfrom() on win32.

darcs-hash:20060920142406-65a35-af0097c64bf1edcf1a69fce58c4c322d9ed0e497.gz
parent 9eb219ec
......@@ -99,23 +99,32 @@ typedef unsigned _int32 uint32_t;
#if HAVE_WINSOCK2_H
/* Posix send() */
static inline
ssize_t sres_send(sres_socket_t s, void *b, size_t len, int flags)
ssize_t sres_send(sres_socket_t s, void *b, size_t length, int flags)
{
return (ssize_t)send(s, b, (int)len, flags);
if (length > INT_MAX)
length = INT_MAX;
return (ssize_t)send(s, b, (int)length, flags);
}
/* Posix recvfrom() */
static inline
ssize_t sres_recvfrom(sres_socket_t s, void *b, size_t len, int flags,
ssize_t sres_recvfrom(sres_socket_t s, void *buffer, size_t length, int flags,
struct sockaddr *from, socklen_t *fromlen)
{
int ilen;
int retval;
int retval, ilen;
if (fromlen)
ilen = *fromlen;
retval = recvfrom(s, b, (int)len, flags, from, fromlen ? &ilen : NULL);
if (length > INT_MAX)
length = INT_MAX;
retval = recvfrom(s, buffer, (int)length, flags,
(void *)from, fromlen ? &ilen : NULL);
if (fromlen)
*fromlen = ilen;
return (ssize_t)retval;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment