mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:33:31 +03:00
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).
This commit is contained in:
parent
1d7ce36791
commit
d60c22572b
11 changed files with 54 additions and 25 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue