rpms/curl/F-12 curl-7.19.7-dns-timeout.patch, NONE, 1.1 curl-7.19.7-CHANGES.patch, 1.1, 1.2 curl.spec, 1.135, 1.136
Kamil Dudka
kdudka at fedoraproject.org
Tue Mar 23 14:56:53 UTC 2010
Author: kdudka
Update of /cvs/extras/rpms/curl/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv15300
Modified Files:
curl-7.19.7-CHANGES.patch curl.spec
Added Files:
curl-7.19.7-dns-timeout.patch
Log Message:
- remove signal handler in case of DNS timeout (upstream commit 6657f12)
curl-7.19.7-dns-timeout.patch:
hostip.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
--- NEW FILE curl-7.19.7-dns-timeout.patch ---
diff --git a/lib/hostip.c b/lib/hostip.c
index 113c6d2..94f7b4c 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -579,15 +579,6 @@ int Curl_resolv_timeout(struct connectdata *conn,
return CURLRESOLV_TIMEDOUT;
if (timeout > 0) {
- /* This allows us to time-out from the name resolver, as the timeout
- will generate a signal and we will siglongjmp() from that here.
- This technique has problems (see alarmfunc). */
- if(sigsetjmp(curl_jmpenv, 1)) {
- /* this is coming from a siglongjmp() after an alarm signal */
- failf(data, "name lookup timed out");
- return CURLRESOLV_ERROR;
- }
-
/*************************************************************
* Set signal handler to catch SIGALRM
* Store the old value to be able to set it back later!
@@ -613,6 +604,19 @@ int Curl_resolv_timeout(struct connectdata *conn,
/* alarm() makes a signal get sent when the timeout fires off, and that
will abort system calls */
prev_alarm = alarm((unsigned int) (timeout/1000L));
+
+ /* This allows us to time-out from the name resolver, as the timeout
+ will generate a signal and we will siglongjmp() from that here.
+ This technique has problems (see alarmfunc).
+ This should be the last thing we do before calling Curl_resolv(),
+ as otherwise we'd have to worry about variables that get modified
+ before we invoke Curl_resolv() (and thus use "volatile"). */
+ if(sigsetjmp(curl_jmpenv, 1)) {
+ /* this is coming from a siglongjmp() after an alarm signal */
+ failf(data, "name lookup timed out");
+ rc = CURLRESOLV_ERROR;
+ goto clean_up;
+ }
}
#else
@@ -629,6 +633,8 @@ int Curl_resolv_timeout(struct connectdata *conn,
*/
rc = Curl_resolv(conn, hostname, port, entry);
+clean_up:
+
#ifdef USE_ALARM_TIMEOUT
if (timeout > 0) {
curl-7.19.7-CHANGES.patch:
CHANGES | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
Index: curl-7.19.7-CHANGES.patch
===================================================================
RCS file: /cvs/extras/rpms/curl/F-12/curl-7.19.7-CHANGES.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- curl-7.19.7-CHANGES.patch 11 Feb 2010 17:39:10 -0000 1.1
+++ curl-7.19.7-CHANGES.patch 23 Mar 2010 14:56:52 -0000 1.2
@@ -1,11 +1,24 @@
diff --git a/CHANGES b/CHANGES
-index a77aa0a..a603a7d 100644
+index a77aa0a..d24fa3e 100644
--- a/CHANGES
+++ b/CHANGES
-@@ -6,6 +6,24 @@
+@@ -6,6 +6,37 @@
Changelog
++Daniel Stenberg (22 Mar 2010)
++- Thomas Lopatic fixed the alarm()-based DNS timeout:
++
++ Looking at the code of Curl_resolv_timeout() in hostip.c, I think that in
++ case of a timeout, the signal handler for SIGALRM never gets removed. I
++ think that in my case it gets executed at some point later on when execution
++ has long left Curl_resolv_timeout() or even the cURL library.
++
++ The code that is jumped to with siglongjmp() simply sets the error message
++ to "name lookup timed out" and then returns with CURLRESOLV_ERROR. I guess
++ that instead of simply returning without cleaning up, the code should have a
++ goto that jumps to the spot right after the call to Curl_resolv().
++
+Björn Stenberg (23 Jan 2010)
+- Added a new flag: -J/--remote-header-name. This option tells the
+ -O/--remote-name option to use the server-specified Content-Disposition
Index: curl.spec
===================================================================
RCS file: /cvs/extras/rpms/curl/F-12/curl.spec,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -p -r1.135 -r1.136
--- curl.spec 28 Feb 2010 16:39:32 -0000 1.135
+++ curl.spec 23 Mar 2010 14:56:52 -0000 1.136
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.19.7
-Release: 8%{?dist}
+Release: 9%{?dist}
License: MIT
Group: Applications/Internet
Source: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
@@ -12,6 +12,7 @@ Patch3: curl-7.19.7-nss-warning.patch
Patch4: curl-7.19.7-ssl-timeout.patch
Patch5: curl-7.19.7-content-disposition.patch
Patch6: curl-7.19.7-CHANGES.patch
+Patch7: curl-7.19.7-dns-timeout.patch
Patch101: curl-7.15.3-multilib.patch
Patch102: curl-7.16.0-privlibs.patch
Patch103: curl-7.19.4-debug.patch
@@ -81,12 +82,19 @@ use cURL's capabilities internally.
%prep
%setup -q
+# Convert docs to UTF-8
+for f in CHANGES README; do
+ iconv -f iso-8859-1 -t utf8 < ${f} > ${f}.utf8
+ mv -f ${f}.utf8 ${f}
+done
+
# upstream patches (already applied)
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1
# other patches
%patch4 -p1
@@ -110,12 +118,6 @@ autoconf
# replace hard wired port numbers in the test suite
sed -i s/899\\\([0-9]\\\)/%{?__isa_bits}9\\1/ tests/data/test*
-# Convert docs to UTF-8
-for f in CHANGES README; do
- iconv -f iso-8859-1 -t utf8 < ${f} > ${f}.utf8
- mv -f ${f}.utf8 ${f}
-done
-
%build
%configure --without-ssl --with-nss --enable-ipv6 \
--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt \
@@ -195,6 +197,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/aclocal/libcurl.m4
%changelog
+* Tue Mar 23 2010 Kamil Dudka <kdudka at redhat.com> - 7.19.7-9
+- remove signal handler in case of DNS timeout (upstream commit 6657f12)
+
* Sun Feb 28 2010 Dennis Gilmore <dennis at ausil.us> 7.19.7-8
- no valgrind on sparc arches
More information about the scm-commits
mailing list