aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-09-07 20:35:37 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-09-07 20:35:37 +0000
commit7350f9851af2a8a744e352246f8eb65cb9ffbe59 (patch)
tree8703728982e6e0657da2e79844fd1516e9e0722d /lib
parentd030dfa6e2eb0193168dd72f336c8426c5a7942d (diff)
TFTP now reports the "not defined" TFTP error code 0 as an error,
not success.
Diffstat (limited to 'lib')
-rw-r--r--lib/tftp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index cfa20a6b2..a3a69cf6c 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -115,6 +115,9 @@ typedef enum {
TFTP_ERR_UNKNOWNID,
TFTP_ERR_EXISTS,
TFTP_ERR_NOSUCHUSER, /* This will never be triggered by this code */
+
+ /* The remaining error codes are internal to curl */
+ TFTP_ERR_NONE = -100,
TFTP_ERR_TIMEOUT,
TFTP_ERR_NORESPONSE
} tftp_error_t;
@@ -588,6 +591,7 @@ CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done)
state->conn = conn;
state->sockfd = state->conn->sock[FIRSTSOCKET];
state->state = TFTP_STATE_START;
+ state->error = TFTP_ERR_NONE;
((struct sockaddr *)&state->local_addr)->sa_family =
(unsigned short)(conn->ip_addr->ai_family);
@@ -790,7 +794,7 @@ CURLcode Curl_tftp(struct connectdata *conn, bool *done)
return code;
/* If we have encountered an error */
- if(state->error) {
+ if(state->error != TFTP_ERR_NONE) {
/* Translate internal error codes to curl error codes */
switch(state->error) {
@@ -803,6 +807,7 @@ CURLcode Curl_tftp(struct connectdata *conn, bool *done)
case TFTP_ERR_DISKFULL:
code = CURLE_REMOTE_DISK_FULL;
break;
+ case TFTP_ERR_UNDEF:
case TFTP_ERR_ILLEGAL:
code = CURLE_TFTP_ILLEGAL;
break;