aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-05-18 10:12:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-05-18 10:12:57 +0000
commited4936fd30122d142e89f11518b2f3bc66fea721 (patch)
tree2ab8973539f075b65b523270ceb5dda62cca49e6
parent4dd2628093cac4155899458504e7a7ea0eeed820 (diff)
bail out with error codes on failures
-rw-r--r--lib/tftp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index c203f4fdf..038306d86 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -371,6 +371,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
state->remote_addrlen);
if(sbytes < 0) {
failf(data, "%s\n", Curl_strerror(state->conn, SOCKERRNO));
+ return CURLE_SEND_ERROR;
}
/* Check if completed (That is, a less than full packet is received) */
@@ -400,6 +401,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
/* Check all sbytes were sent */
if(sbytes<0) {
failf(data, "%s\n", Curl_strerror(state->conn, SOCKERRNO));
+ return CURLE_SEND_ERROR;
}
}
break;
@@ -410,7 +412,8 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
default:
failf(data, "%s\n", "tftp_rx: internal error");
- break;
+ return CURLE_TFTP_ILLEGAL; /* not really the perfect return code for
+ this */
}
Curl_pgrsSetDownloadCounter(data,
(curl_off_t) state->block*TFTP_BLOCKSIZE);
@@ -685,7 +688,8 @@ CURLcode Curl_tftp(struct connectdata *conn, bool *done)
code=tftp_state_machine(state, event) ) {
/* Wait until ready to read or timeout occurs */
- rc=Curl_socket_ready(state->sockfd, CURL_SOCKET_BAD, state->retry_time * 1000);
+ rc=Curl_socket_ready(state->sockfd, CURL_SOCKET_BAD,
+ state->retry_time * 1000);
if(rc == -1) {
/* bail out */