3
0
Fork 0
forked from mirrors/nixpkgs

* curl updated to 7.22.0. Dropped the connect timeout patch because

it doesn't seem necessary anymore.

svn path=/nixpkgs/trunk/; revision=30243
This commit is contained in:
Eelco Dolstra 2011-11-05 01:55:53 +00:00
parent a0cf7c24e1
commit 4d95b41bc8
2 changed files with 2 additions and 169 deletions

View file

@ -1,156 +0,0 @@
diff -rc curl-7.19.3-orig/lib/connect.c curl-7.19.3/lib/connect.c
*** curl-7.19.3-orig/lib/connect.c 2009-01-02 23:30:50.000000000 +0100
--- curl-7.19.3/lib/connect.c 2009-01-21 15:04:08.000000000 +0100
***************
*** 115,121 ****
singleipconnect(struct connectdata *conn,
const Curl_addrinfo *ai, /* start connecting to this */
long timeout_ms,
! bool *connected);
/*
* Curl_timeleft() returns the amount of milliseconds left allowed for the
--- 115,122 ----
singleipconnect(struct connectdata *conn,
const Curl_addrinfo *ai, /* start connecting to this */
long timeout_ms,
! bool *connected,
! bool *timed_out);
/*
* Curl_timeleft() returns the amount of milliseconds left allowed for the
***************
*** 541,546 ****
--- 542,548 ----
{
curl_socket_t sockfd;
Curl_addrinfo *ai;
+ bool timed_out;
/* first close the failed socket */
sclose(conn->sock[sockindex]);
***************
*** 554,560 ****
ai = conn->ip_addr->ai_next;
while(ai) {
! sockfd = singleipconnect(conn, ai, 0L, connected);
if(sockfd != CURL_SOCKET_BAD) {
/* store the new socket descriptor */
conn->sock[sockindex] = sockfd;
--- 556,562 ----
ai = conn->ip_addr->ai_next;
while(ai) {
! sockfd = singleipconnect(conn, ai, 0L, connected, &timed_out);
if(sockfd != CURL_SOCKET_BAD) {
/* store the new socket descriptor */
conn->sock[sockindex] = sockfd;
***************
*** 714,720 ****
singleipconnect(struct connectdata *conn,
const Curl_addrinfo *ai,
long timeout_ms,
! bool *connected)
{
struct Curl_sockaddr_ex addr;
char addr_buf[128];
--- 716,723 ----
singleipconnect(struct connectdata *conn,
const Curl_addrinfo *ai,
long timeout_ms,
! bool *connected,
! bool *timed_out)
{
struct Curl_sockaddr_ex addr;
char addr_buf[128];
***************
*** 730,735 ****
--- 733,740 ----
struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
#endif
+ *timed_out = FALSE;
+
/*
* The Curl_sockaddr_ex structure is basically libcurl's external API
* curl_sockaddr structure with enough space available to directly hold
***************
*** 880,887 ****
infof(data, "connected\n");
return sockfd;
}
! else if(WAITCONN_TIMEOUT == rc)
infof(data, "Timeout\n");
else {
data->state.os_errno = error;
infof(data, "%s\n", Curl_strerror(conn, error));
--- 885,894 ----
infof(data, "connected\n");
return sockfd;
}
! else if(WAITCONN_TIMEOUT == rc) {
! *timed_out = TRUE;
infof(data, "Timeout\n");
+ }
else {
data->state.os_errno = error;
infof(data, "%s\n", Curl_strerror(conn, error));
***************
*** 911,918 ****
int num_addr;
Curl_addrinfo *ai;
Curl_addrinfo *curr_addr;
- struct timeval after;
struct timeval before = Curl_tvnow();
/*************************************************************
--- 918,925 ----
int num_addr;
Curl_addrinfo *ai;
Curl_addrinfo *curr_addr;
+ bool timed_out;
struct timeval before = Curl_tvnow();
/*************************************************************
***************
*** 955,973 ****
curr_addr = curr_addr->ai_next, aliasindex++) {
/* start connecting to the IP curr_addr points to */
! sockfd = singleipconnect(conn, curr_addr, timeout_per_addr, connected);
if(sockfd != CURL_SOCKET_BAD)
break;
! /* get a new timeout for next attempt */
! after = Curl_tvnow();
! timeout_ms -= Curl_tvdiff(after, before);
! if(timeout_ms < 0) {
failf(data, "connect() timed out!");
return CURLE_OPERATION_TIMEDOUT;
}
- before = after;
} /* end of connect-to-each-address loop */
*sockconn = sockfd; /* the socket descriptor we've connected */
--- 962,978 ----
curr_addr = curr_addr->ai_next, aliasindex++) {
/* start connecting to the IP curr_addr points to */
! sockfd = singleipconnect(conn, curr_addr, timeout_per_addr, connected, &timed_out);
if(sockfd != CURL_SOCKET_BAD)
break;
! /* if this is the last address and it timed out, propagate the
! timeout to the caller */
! if(!curr_addr->ai_next && timed_out) {
failf(data, "connect() timed out!");
return CURLE_OPERATION_TIMEDOUT;
}
} /* end of connect-to-each-address loop */
*sockconn = sockfd; /* the socket descriptor we've connected */

View file

@ -10,11 +10,11 @@ assert sslSupport -> openssl != null;
assert scpSupport -> libssh2 != null;
stdenv.mkDerivation rec {
name = "curl-7.21.0";
name = "curl-7.22.0";
src = fetchurl {
url = "http://curl.haxx.se/download/${name}.tar.bz2";
sha256 = "1fl7sh38i746b57aqjqjaykwq4rhm2p1phzrgnc2h6wm2k2b95gy";
sha256 = "04ji7v06f33y6plvikwj283ad6fxxxjpm7as9xw25c924f3dm85x";
};
# Zlib and OpenSSL must be propagated because `libcurl.la' contains
@ -59,17 +59,6 @@ stdenv.mkDerivation rec {
substituteInPlace configure --replace /usr/bin /no-such-path
'';
patches = [
/* Fixes broken retry support when a timeout is used. The
select() system call (used to wait for the connection to come
up) can return slightly before the computed deadline (a few
milliseconds). Curl will think the problem is something else,
proceed with the next IP address (which usually doesn't exist),
then barf with a CURLE_COULDNT_CONNECT error, which is
considered non-transient so it won't retry. */
./connect-timeout.patch
];
meta = {
description = "A command line tool for transferring files with URL syntax";
homepage = http://curl.haxx.se/;