Sync fetch code with libfetch-2.27.

joerg@netbsd libfetch-2.27:
The connection sharing didn't handle the case of active transfers
correctly and tried to close the connection in that case (PR 42607).
Correctly check if there is a transfer going on and just leave the
connection alone in that case.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100111192421-5fddbsek3ayi9wm8
This commit is contained in:
Juan RP 2010-01-11 20:24:21 +01:00
parent ec907d0646
commit e404632f7e

View File

@ -1083,7 +1083,7 @@ ftp_cached_connect(struct url *url, struct url *purl, const char *flags)
return (NULL);
doc = strdup(url->doc);
if (doc != NULL) {
if (cached_connection)
if (cached_connection && !cached_connection->is_active)
ftp_disconnect(cached_connection);
cached_connection = fetch_ref(conn);
memcpy(&cached_host, url, sizeof(*url));