aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-12 12:06:39 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-12 12:06:39 +0000
commitd60c22572b49cde9b839a59510580df079d2d5e2 (patch)
treec67a83d1a6216ec2be4f39117f1934650a67989e /lib/transfer.c
parent1d7ce36791f32039383236e4940994c41cb2a0bf (diff)
Curl_done() and the protocol-specific conn->curl_done() functions now all
take a CURLcode as a second argument, that is non-zero when Curl_done() is called after an error was returned from Curl_do() (or similar).
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 67f328971..95dbf568a 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -853,6 +853,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
*ptr = '\0'; /* zero terminate */
conn->newurl = strdup(start); /* clone string */
*ptr = backup; /* restore ending letter */
+ if(!conn->newurl)
+ return CURLE_OUT_OF_MEMORY;
}
}
#if 0 /* for consideration */
@@ -1967,7 +1969,7 @@ CURLcode Curl_perform(struct SessionHandle *data)
to the new URL */
urlchanged = data->change.url_changed;
if ((CURLE_OK == res) && urlchanged) {
- res = Curl_done(conn);
+ res = Curl_done(conn, res);
if(CURLE_OK == res) {
char *gotourl = strdup(data->change.url);
res = Curl_follow(data, gotourl);
@@ -2024,14 +2026,14 @@ CURLcode Curl_perform(struct SessionHandle *data)
/* Always run Curl_done(), even if some of the previous calls
failed, but return the previous (original) error code */
- res2 = Curl_done(conn);
+ res2 = Curl_done(conn, res);
if(CURLE_OK == res)
res = res2;
}
else
/* Curl_do() failed, clean up left-overs in the done-call */
- res2 = Curl_done(conn);
+ res2 = Curl_done(conn, res);
/*
* Important: 'conn' cannot be used here, since it may have been closed