Curl_setup_transfer: no longer returns anything
This function could only return CURLE_OK and by changing it to a void instead, we can simplify code all over.
This commit is contained in:
13
lib/tftp.c
13
lib/tftp.c
@@ -797,10 +797,9 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
||||
state->state = TFTP_STATE_FIN;
|
||||
setpacketevent(&state->spacket, TFTP_EVENT_ERROR);
|
||||
setpacketblock(&state->spacket, state->block);
|
||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
||||
4, SEND_4TH_ARG,
|
||||
(struct sockaddr *)&state->remote_addr,
|
||||
state->remote_addrlen);
|
||||
(void)sendto(state->sockfd, (void *)state->spacket.data, 4, SEND_4TH_ARG,
|
||||
(struct sockaddr *)&state->remote_addr,
|
||||
state->remote_addrlen);
|
||||
/* don't bother with the return code, but if the socket is still up we
|
||||
* should be a good TFTP client and let the server know we're done */
|
||||
state->state = TFTP_STATE_FIN;
|
||||
@@ -1295,7 +1294,7 @@ static CURLcode tftp_easy_statemach(struct connectdata *conn)
|
||||
}
|
||||
|
||||
/* Tell curl we're done */
|
||||
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
|
||||
return(result);
|
||||
}
|
||||
@@ -1329,7 +1328,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
|
||||
*done = (bool)(state->state == TFTP_STATE_FIN);
|
||||
if(*done)
|
||||
/* Tell curl we're done */
|
||||
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
}
|
||||
else {
|
||||
/* no timeouts to handle, check our socket */
|
||||
@@ -1351,7 +1350,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
|
||||
*done = (bool)(state->state == TFTP_STATE_FIN);
|
||||
if(*done)
|
||||
/* Tell curl we're done */
|
||||
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
}
|
||||
/* if rc == 0, then select() timed out */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user