Loading CHANGES +3 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,9 @@ Changelog Yang Tse (21 Jul 2008) - Use the sreadfrom() wrapper to replace recvfrom() in our code. Yang Tse (20 Jul 2008) - when recvfrom prototype uses a void pointer for arguments 2, 5 or 6 this will now cause the definition, as appropriate, of RECVFROM_TYPE_ARG2_IS_VOID, Loading ares/setup_once.h +7 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,13 @@ struct timeval { #endif /* HAVE_RECVFROM */ #ifdef RECVFROM_TYPE_ARG6_IS_VOID # define RECVFROM_ARG6_T unsigned int #else # define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 #endif /* * Uppercase macro versions of ANSI/ISO is*() functions/macros which * avoid negative number inputs with argument byte codes > 127. Loading lib/setup_once.h +7 −0 Original line number Diff line number Diff line Loading @@ -229,6 +229,13 @@ struct timeval { #endif /* HAVE_RECVFROM */ #ifdef RECVFROM_TYPE_ARG6_IS_VOID # define RECVFROM_ARG6_T unsigned int #else # define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 #endif /* * Uppercase macro versions of ANSI/ISO is*() functions/macros which * avoid negative number inputs with argument byte codes > 127. Loading lib/tftp.c +7 −7 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ typedef struct tftp_state_data { struct Curl_sockaddr_storage local_addr; struct Curl_sockaddr_storage remote_addr; socklen_t remote_addrlen; int rbytes; ssize_t rbytes; int sbytes; tftp_packet_t rpacket; tftp_packet_t spacket; Loading Loading @@ -420,7 +420,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) } /* Check if completed (That is, a less than full packet is received) */ if(state->rbytes < (int)sizeof(state->spacket)){ if(state->rbytes < sizeof(state->spacket)){ state->state = TFTP_STATE_FIN; } else { Loading Loading @@ -717,7 +717,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done) CURLcode code; int rc; struct Curl_sockaddr_storage fromaddr; socklen_t fromlen; RECVFROM_ARG6_T fromlen; int check_time = 0; struct SingleRequest *k = &data->req; Loading Loading @@ -764,10 +764,10 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done) else { /* Receive the packet */ fromlen=sizeof(fromaddr); state->rbytes = recvfrom(state->sockfd, (void *)&state->rpacket, sizeof(state->rpacket), 0, (struct sockaddr *)&fromaddr, &fromlen); fromlen = (RECVFROM_ARG6_T)sizeof(fromaddr); state->rbytes = sreadfrom(state->sockfd, &state->rpacket, sizeof(state->rpacket), &fromaddr, &fromlen); if(state->remote_addrlen==0) { memcpy(&state->remote_addr, &fromaddr, fromlen); state->remote_addrlen = fromlen; Loading tests/server/tftpd.c +7 −9 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ static int maxtimeout = 5*TIMEOUT; static char buf[PKTSIZE]; static char ackbuf[PKTSIZE]; static struct sockaddr_in from; static socklen_t fromlen; static RECVFROM_ARG6_T fromlen; struct bf { int counter; /* size of data in buffer, or flag */ Loading Loading @@ -355,7 +355,7 @@ static int synchnet(curl_socket_t f /* socket to flush */) int j = 0; char rbuf[PKTSIZE]; struct sockaddr_in fromaddr; socklen_t fromaddrlen; RECVFROM_ARG6_T fromaddrlen; while (1) { #if defined(HAVE_IOCTLSOCKET) Loading @@ -365,9 +365,8 @@ static int synchnet(curl_socket_t f /* socket to flush */) #endif if (i) { j++; fromaddrlen = sizeof fromaddr; (void) recvfrom(f, rbuf, sizeof (rbuf), 0, (struct sockaddr *)&fromaddr, &fromaddrlen); fromaddrlen = (RECVFROM_ARG6_T)sizeof(fromaddr); (void)sreadfrom(f, rbuf, sizeof(rbuf), &fromaddr, &fromaddrlen); } else break; Loading Loading @@ -407,7 +406,7 @@ int main(int argc, char **argv) #endif /* ENABLE_IPV6 */ struct tftphdr *tp; int n = 0; ssize_t n = 0; int arg = 1; char *pidname= (char *)".tftpd.pid"; unsigned short port = DEFAULT_PORT; Loading Loading @@ -514,9 +513,8 @@ int main(int argc, char **argv) , port ); do { fromlen = sizeof(from); n = recvfrom(sock, buf, sizeof (buf), 0, (struct sockaddr *)&from, &fromlen); fromlen = (RECVFROM_ARG6_T)sizeof(from); n = sreadfrom(sock, buf, sizeof(buf), &from, &fromlen); if (n < 0) { logmsg("recvfrom:\n"); result = 3; Loading Loading
CHANGES +3 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,9 @@ Changelog Yang Tse (21 Jul 2008) - Use the sreadfrom() wrapper to replace recvfrom() in our code. Yang Tse (20 Jul 2008) - when recvfrom prototype uses a void pointer for arguments 2, 5 or 6 this will now cause the definition, as appropriate, of RECVFROM_TYPE_ARG2_IS_VOID, Loading
ares/setup_once.h +7 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,13 @@ struct timeval { #endif /* HAVE_RECVFROM */ #ifdef RECVFROM_TYPE_ARG6_IS_VOID # define RECVFROM_ARG6_T unsigned int #else # define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 #endif /* * Uppercase macro versions of ANSI/ISO is*() functions/macros which * avoid negative number inputs with argument byte codes > 127. Loading
lib/setup_once.h +7 −0 Original line number Diff line number Diff line Loading @@ -229,6 +229,13 @@ struct timeval { #endif /* HAVE_RECVFROM */ #ifdef RECVFROM_TYPE_ARG6_IS_VOID # define RECVFROM_ARG6_T unsigned int #else # define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 #endif /* * Uppercase macro versions of ANSI/ISO is*() functions/macros which * avoid negative number inputs with argument byte codes > 127. Loading
lib/tftp.c +7 −7 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ typedef struct tftp_state_data { struct Curl_sockaddr_storage local_addr; struct Curl_sockaddr_storage remote_addr; socklen_t remote_addrlen; int rbytes; ssize_t rbytes; int sbytes; tftp_packet_t rpacket; tftp_packet_t spacket; Loading Loading @@ -420,7 +420,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) } /* Check if completed (That is, a less than full packet is received) */ if(state->rbytes < (int)sizeof(state->spacket)){ if(state->rbytes < sizeof(state->spacket)){ state->state = TFTP_STATE_FIN; } else { Loading Loading @@ -717,7 +717,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done) CURLcode code; int rc; struct Curl_sockaddr_storage fromaddr; socklen_t fromlen; RECVFROM_ARG6_T fromlen; int check_time = 0; struct SingleRequest *k = &data->req; Loading Loading @@ -764,10 +764,10 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done) else { /* Receive the packet */ fromlen=sizeof(fromaddr); state->rbytes = recvfrom(state->sockfd, (void *)&state->rpacket, sizeof(state->rpacket), 0, (struct sockaddr *)&fromaddr, &fromlen); fromlen = (RECVFROM_ARG6_T)sizeof(fromaddr); state->rbytes = sreadfrom(state->sockfd, &state->rpacket, sizeof(state->rpacket), &fromaddr, &fromlen); if(state->remote_addrlen==0) { memcpy(&state->remote_addr, &fromaddr, fromlen); state->remote_addrlen = fromlen; Loading
tests/server/tftpd.c +7 −9 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ static int maxtimeout = 5*TIMEOUT; static char buf[PKTSIZE]; static char ackbuf[PKTSIZE]; static struct sockaddr_in from; static socklen_t fromlen; static RECVFROM_ARG6_T fromlen; struct bf { int counter; /* size of data in buffer, or flag */ Loading Loading @@ -355,7 +355,7 @@ static int synchnet(curl_socket_t f /* socket to flush */) int j = 0; char rbuf[PKTSIZE]; struct sockaddr_in fromaddr; socklen_t fromaddrlen; RECVFROM_ARG6_T fromaddrlen; while (1) { #if defined(HAVE_IOCTLSOCKET) Loading @@ -365,9 +365,8 @@ static int synchnet(curl_socket_t f /* socket to flush */) #endif if (i) { j++; fromaddrlen = sizeof fromaddr; (void) recvfrom(f, rbuf, sizeof (rbuf), 0, (struct sockaddr *)&fromaddr, &fromaddrlen); fromaddrlen = (RECVFROM_ARG6_T)sizeof(fromaddr); (void)sreadfrom(f, rbuf, sizeof(rbuf), &fromaddr, &fromaddrlen); } else break; Loading Loading @@ -407,7 +406,7 @@ int main(int argc, char **argv) #endif /* ENABLE_IPV6 */ struct tftphdr *tp; int n = 0; ssize_t n = 0; int arg = 1; char *pidname= (char *)".tftpd.pid"; unsigned short port = DEFAULT_PORT; Loading Loading @@ -514,9 +513,8 @@ int main(int argc, char **argv) , port ); do { fromlen = sizeof(from); n = recvfrom(sock, buf, sizeof (buf), 0, (struct sockaddr *)&from, &fromlen); fromlen = (RECVFROM_ARG6_T)sizeof(from); n = sreadfrom(sock, buf, sizeof(buf), &from, &fromlen); if (n < 0) { logmsg("recvfrom:\n"); result = 3; Loading