mirror of
https://github.com/moparisthebest/curl
synced 2024-11-13 13:05:03 -05:00
changes to silent compiler warnings with 64bit systems.
This commit is contained in:
parent
2f6ff57d96
commit
59934c1176
46
lib/tftp.c
46
lib/tftp.c
@ -354,7 +354,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
|
|||||||
if(checkprefix(option, TFTP_OPTION_BLKSIZE)) {
|
if(checkprefix(option, TFTP_OPTION_BLKSIZE)) {
|
||||||
int blksize;
|
int blksize;
|
||||||
|
|
||||||
blksize = strtol( value, NULL, 10 );
|
blksize = (int)strtol( value, NULL, 10 );
|
||||||
|
|
||||||
if(!blksize) {
|
if(!blksize) {
|
||||||
failf(data, "invalid blocksize value in OACK packet");
|
failf(data, "invalid blocksize value in OACK packet");
|
||||||
@ -440,7 +440,7 @@ static CURLcode tftp_connect_for_rx(tftp_state_data_t *state, tftp_event_t event
|
|||||||
|
|
||||||
static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
||||||
{
|
{
|
||||||
int sbytes;
|
size_t sbytes;
|
||||||
const char *mode = "octet";
|
const char *mode = "octet";
|
||||||
char *filename;
|
char *filename;
|
||||||
char buf[8];
|
char buf[8];
|
||||||
@ -509,11 +509,10 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes, buf );
|
(char *)state->spacket.data+sbytes, buf );
|
||||||
|
|
||||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
if (sendto(state->sockfd, (void *)state->spacket.data,
|
||||||
sbytes, 0,
|
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) < 0) {
|
||||||
if(sbytes < 0) {
|
|
||||||
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
||||||
}
|
}
|
||||||
Curl_safefree(filename);
|
Curl_safefree(filename);
|
||||||
@ -556,7 +555,6 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
**********************************************************/
|
**********************************************************/
|
||||||
static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
||||||
{
|
{
|
||||||
int sbytes;
|
|
||||||
int rblock;
|
int rblock;
|
||||||
struct SessionHandle *data = state->conn->data;
|
struct SessionHandle *data = state->conn->data;
|
||||||
|
|
||||||
@ -581,11 +579,10 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
state->retries = 0;
|
state->retries = 0;
|
||||||
setpacketevent(&state->spacket, TFTP_EVENT_ACK);
|
setpacketevent(&state->spacket, TFTP_EVENT_ACK);
|
||||||
setpacketblock(&state->spacket, state->block);
|
setpacketblock(&state->spacket, state->block);
|
||||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
if(sendto(state->sockfd, (void *)state->spacket.data,
|
||||||
4, SEND_4TH_ARG,
|
4, SEND_4TH_ARG,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen) < 0) {
|
||||||
if(sbytes < 0) {
|
|
||||||
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
||||||
return CURLE_SEND_ERROR;
|
return CURLE_SEND_ERROR;
|
||||||
}
|
}
|
||||||
@ -605,11 +602,10 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
state->retries = 0;
|
state->retries = 0;
|
||||||
setpacketevent(&state->spacket, TFTP_EVENT_ACK);
|
setpacketevent(&state->spacket, TFTP_EVENT_ACK);
|
||||||
setpacketblock(&state->spacket, state->block);
|
setpacketblock(&state->spacket, state->block);
|
||||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
if(sendto(state->sockfd, (void *)state->spacket.data,
|
||||||
4, SEND_4TH_ARG,
|
4, SEND_4TH_ARG,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen)) < 0) {
|
||||||
if(sbytes < 0) {
|
|
||||||
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
||||||
return CURLE_SEND_ERROR;
|
return CURLE_SEND_ERROR;
|
||||||
}
|
}
|
||||||
@ -628,13 +624,11 @@ static CURLcode 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 and check all sbytes were sent */
|
||||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
if(sendto(state->sockfd, (void *)state->spacket.data,
|
||||||
4, SEND_4TH_ARG,
|
4, SEND_4TH_ARG,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen) < 0) {
|
||||||
/* Check all sbytes were sent */
|
|
||||||
if(sbytes<0) {
|
|
||||||
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
|
||||||
return CURLE_SEND_ERROR;
|
return CURLE_SEND_ERROR;
|
||||||
}
|
}
|
||||||
@ -663,7 +657,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
||||||
{
|
{
|
||||||
struct SessionHandle *data = state->conn->data;
|
struct SessionHandle *data = state->conn->data;
|
||||||
int sbytes;
|
ssize_t sbytes;
|
||||||
int rblock;
|
int rblock;
|
||||||
int readcount;
|
int readcount;
|
||||||
CURLcode res = CURLE_OK;
|
CURLcode res = CURLE_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user