mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Yang Tse's patch to silence MSVC warnings
This commit is contained in:
parent
cfff544d67
commit
05a6013f42
12
lib/tftp.c
12
lib/tftp.c
@ -278,7 +278,8 @@ static void tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
sprintf((char *)state->spacket.u.request.data, "%s%c%s%c",
|
sprintf((char *)state->spacket.u.request.data, "%s%c%s%c",
|
||||||
filename, '\0', mode, '\0');
|
filename, '\0', mode, '\0');
|
||||||
sbytes = 4 + strlen(filename) + strlen(mode);
|
sbytes = 4 + strlen(filename) + strlen(mode);
|
||||||
sbytes = sendto(state->sockfd, &state->spacket, sbytes, 0,
|
sbytes = sendto(state->sockfd, (void *)&state->spacket,
|
||||||
|
sbytes, 0,
|
||||||
state->conn->ip_addr->ai_addr,
|
state->conn->ip_addr->ai_addr,
|
||||||
state->conn->ip_addr->ai_addrlen);
|
state->conn->ip_addr->ai_addrlen);
|
||||||
if(sbytes < 0) {
|
if(sbytes < 0) {
|
||||||
@ -345,7 +346,8 @@ static void tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
state->retries = 0;
|
state->retries = 0;
|
||||||
state->spacket.event = htons(TFTP_EVENT_ACK);
|
state->spacket.event = htons(TFTP_EVENT_ACK);
|
||||||
state->spacket.u.ack.block = htons(state->block);
|
state->spacket.u.ack.block = htons(state->block);
|
||||||
sbytes = sendto(state->sockfd, &state->spacket, 4, MSG_NOSIGNAL,
|
sbytes = sendto(state->sockfd, (void *)&state->spacket,
|
||||||
|
4, MSG_NOSIGNAL,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen);
|
||||||
if(sbytes < 0) {
|
if(sbytes < 0) {
|
||||||
@ -371,7 +373,7 @@ static void tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
state->state = TFTP_STATE_FIN;
|
state->state = TFTP_STATE_FIN;
|
||||||
} else {
|
} else {
|
||||||
/* Resend the previous ACK */
|
/* Resend the previous ACK */
|
||||||
sbytes = sendto(state->sockfd, &state->spacket,
|
sbytes = sendto(state->sockfd, (void *)&state->spacket,
|
||||||
4, MSG_NOSIGNAL,
|
4, MSG_NOSIGNAL,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen);
|
||||||
@ -437,7 +439,7 @@ static void tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Curl_fillreadbuffer(state->conn, 512, &state->sbytes);
|
Curl_fillreadbuffer(state->conn, 512, &state->sbytes);
|
||||||
sbytes = sendto(state->sockfd, &state->spacket,
|
sbytes = sendto(state->sockfd, (void *)&state->spacket,
|
||||||
4+state->sbytes, MSG_NOSIGNAL,
|
4+state->sbytes, MSG_NOSIGNAL,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen);
|
||||||
@ -458,7 +460,7 @@ static void tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
state->state = TFTP_STATE_FIN;
|
state->state = TFTP_STATE_FIN;
|
||||||
} else {
|
} else {
|
||||||
/* Re-send the data packet */
|
/* Re-send the data packet */
|
||||||
sbytes = sendto(state->sockfd, &state->spacket,
|
sbytes = sendto(state->sockfd, (void *)&state->spacket,
|
||||||
4+state->sbytes, MSG_NOSIGNAL,
|
4+state->sbytes, MSG_NOSIGNAL,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen);
|
||||||
|
Loading…
Reference in New Issue
Block a user