diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-02-20 08:28:02 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-02-20 08:28:02 +0000 |
commit | 55700cb01f4a01b8187f387e1655371e6fe0703a (patch) | |
tree | b7683b39a639a13b82517bc774b9b7c931f542f4 /lib/transfer.c | |
parent | f9a60620818b6a19ebe3e6f15e1b57d7012e6fb0 (diff) |
- We no longer support setting the CURLOPT_URL option from inside a callback
such as the CURLOPT_SSL_CTX_FUNCTION one treat that as if it was a Location:
following. The patch that introduced this feature was done for 7.11.0, but
this code and functionality has been broken since about 7.15.4 (March 2006)
with the introduction of non-blocking OpenSSL "connects".
It was a hack to begin with and since it doesn't work and hasn't worked
correctly for a long time and nobody has even noticed, I consider it a very
suitable subject for plain removal. And so it was done.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 49397e8c9..86dcfe24f 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -2260,44 +2260,24 @@ connect_host(struct SessionHandle *data, struct connectdata **conn) { CURLcode res = CURLE_OK; - int urlchanged = FALSE; - do { - bool async; - bool protocol_done=TRUE; /* will be TRUE always since this is only used + bool async; + bool protocol_done=TRUE; /* will be TRUE always since this is only used within the easy interface */ - Curl_pgrsTime(data, TIMER_STARTSINGLE); - data->change.url_changed = FALSE; - res = Curl_connect(data, conn, &async, &protocol_done); - - if((CURLE_OK == res) && async) { - /* Now, if async is TRUE here, we need to wait for the name - to resolve */ - res = Curl_wait_for_resolv(*conn, NULL); - if(CURLE_OK == res) - /* Resolved, continue with the connection */ - res = Curl_async_resolved(*conn, &protocol_done); - else - /* if we can't resolve, we kill this "connection" now */ - (void)Curl_disconnect(*conn); - } - if(res) - break; - - /* If a callback (or something) has altered the URL we should use within - the Curl_connect(), we detect it here and act as if we are redirected - to the new URL */ - urlchanged = data->change.url_changed; - if((CURLE_OK == res) && urlchanged) { - res = Curl_done(conn, res, FALSE); - if(CURLE_OK == res) { - char *gotourl = strdup(data->change.url); - res = Curl_follow(data, gotourl, FALSE); - if(res) - free(gotourl); - } - } - } while(urlchanged && res == CURLE_OK); + Curl_pgrsTime(data, TIMER_STARTSINGLE); + res = Curl_connect(data, conn, &async, &protocol_done); + + if((CURLE_OK == res) && async) { + /* Now, if async is TRUE here, we need to wait for the name + to resolve */ + res = Curl_wait_for_resolv(*conn, NULL); + if(CURLE_OK == res) + /* Resolved, continue with the connection */ + res = Curl_async_resolved(*conn, &protocol_done); + else + /* if we can't resolve, we kill this "connection" now */ + (void)Curl_disconnect(*conn); + } return res; } |