aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-07-30 05:10:42 +0000
committerYang Tse <yangsita@gmail.com>2008-07-30 05:10:42 +0000
commit537490e391157f47ccf2957e123019d9356dbe94 (patch)
tree57fb44831f4d147c24e1deb358ba84b95441ebfd /tests
parentde8e362d4a31b707c81420536a3da3efa72903cb (diff)
Undo using the sreadfrom() wrapper to replace recvfrom() in our code.
Diffstat (limited to 'tests')
-rw-r--r--tests/server/tftpd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index c50ea1949..0fe18a2c7 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -132,7 +132,7 @@ static int maxtimeout = 5*TIMEOUT;
static char buf[PKTSIZE];
static char ackbuf[PKTSIZE];
static struct sockaddr_in from;
-static RECVFROM_ARG6_T fromlen;
+static socklen_t fromlen;
struct bf {
int counter; /* size of data in buffer, or flag */
@@ -355,7 +355,7 @@ static int synchnet(curl_socket_t f /* socket to flush */)
int j = 0;
char rbuf[PKTSIZE];
struct sockaddr_in fromaddr;
- RECVFROM_ARG6_T fromaddrlen;
+ socklen_t fromaddrlen;
while (1) {
#if defined(HAVE_IOCTLSOCKET)
@@ -365,8 +365,9 @@ static int synchnet(curl_socket_t f /* socket to flush */)
#endif
if (i) {
j++;
- fromaddrlen = (RECVFROM_ARG6_T)sizeof(fromaddr);
- (void)sreadfrom(f, rbuf, sizeof(rbuf), &fromaddr, &fromaddrlen);
+ fromaddrlen = sizeof(fromaddr);
+ (void)recvfrom(f, rbuf, sizeof(rbuf), 0,
+ (struct sockaddr *)&fromaddr, &fromaddrlen);
}
else
break;
@@ -513,8 +514,9 @@ int main(int argc, char **argv)
, port );
do {
- fromlen = (RECVFROM_ARG6_T)sizeof(from);
- n = sreadfrom(sock, buf, sizeof(buf), &from, &fromlen);
+ fromlen = sizeof(from);
+ n = (ssize_t)sreadfrom(sock, buf, sizeof(buf), 0,
+ (struct sockaddr *)&from, &fromlen);
if (n < 0) {
logmsg("recvfrom:\n");
result = 3;