aboutsummaryrefslogtreecommitdiff
path: root/lib/url.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/url.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/url.c')
-rw-r--r--lib/url.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 2d10998ab..96b02f45a 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3229,6 +3229,8 @@ static CURLcode SetupConnection(struct connectdata *conn,
Curl_safefree(conn->allocptr.uagent);
conn->allocptr.uagent =
aprintf("User-Agent: %s\015\012", data->set.useragent);
+ if(!conn->allocptr.uagent)
+ return CURLE_OUT_OF_MEMORY;
}
}
@@ -3236,6 +3238,8 @@ static CURLcode SetupConnection(struct connectdata *conn,
Curl_safefree(conn->allocptr.accept_encoding);
conn->allocptr.accept_encoding =
aprintf("Accept-Encoding: %s\015\012", data->set.encoding);
+ if(!conn->allocptr.accept_encoding)
+ return CURLE_OUT_OF_MEMORY;
}
conn->bytecount = 0;
@@ -3340,7 +3344,9 @@ CURLcode Curl_async_resolved(struct connectdata *conn)
}
-CURLcode Curl_done(struct connectdata *conn)
+CURLcode Curl_done(struct connectdata *conn,
+ CURLcode status) /* an error if this is called after an
+ error was detected */
{
struct SessionHandle *data=conn->data;
CURLcode result;
@@ -3371,7 +3377,7 @@ CURLcode Curl_done(struct connectdata *conn)
/* this calls the protocol-specific function pointer previously set */
if(conn->curl_done)
- result = conn->curl_done(conn);
+ result = conn->curl_done(conn, status);
else
result = CURLE_OK;
@@ -3423,7 +3429,7 @@ CURLcode Curl_do(struct connectdata **connp)
infof(data, "Re-used connection seems dead, get a new one\n");
conn->bits.close = TRUE; /* enforce close of this connection */
- result = Curl_done(conn); /* we are so done with this */
+ result = Curl_done(conn, result); /* we are so done with this */
/* conn is no longer a good pointer */