From 6f3e7aabdcbc88d4f94232d66d9c071cd96cacfb Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sat, 22 Jun 2013 22:08:42 +0200 Subject: [PATCH 1/5] curl-config.in: replace tabs by spaces --- curl-config.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/curl-config.in b/curl-config.in index e0fa03c2d..1ddf4c2c7 100644 --- a/curl-config.in +++ b/curl-config.in @@ -155,12 +155,12 @@ while test $# -gt 0; do ;; --static-libs) - if test "X@ENABLE_STATIC@" != "Xno" ; then - echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ - else - echo "curl was built with static libraries disabled" >&2 - exit 1 - fi + if test "X@ENABLE_STATIC@" != "Xno" ; then + echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ + else + echo "curl was built with static libraries disabled" >&2 + exit 1 + fi ;; --configure) From 02964ed630c0fc74b47d0c94735d328661388d69 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sat, 22 Jun 2013 22:12:49 +0200 Subject: [PATCH 2/5] test1230: avoid using hard-wired port number ... to prevent failure when a non-default -b option is given --- tests/data/test1230 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test1230 b/tests/data/test1230 index ab56b4fd3..a07185044 100644 --- a/tests/data/test1230 +++ b/tests/data/test1230 @@ -71,7 +71,7 @@ Host: [1234:1234:1234::4ce]:%HTTPPORT Proxy-Connection: Keep-Alive GET /wanted/page/1230 HTTP/1.1 -Host: [1234:1234:1234::4ce]:8990 +Host: [1234:1234:1234::4ce]:%HTTPPORT Accept: */* From 6fab0bd9f163430254259f6b7d5c75b5452257d3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 22 Jun 2013 22:20:31 +0200 Subject: [PATCH 3/5] test1396: invoke the correct test tool! This erroneously run unit test 1310 instead of 1396! --- tests/data/test1396 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test1396 b/tests/data/test1396 index 949bb2daf..8ffe35f4c 100644 --- a/tests/data/test1396 +++ b/tests/data/test1396 @@ -20,7 +20,7 @@ unittest curl_easy_escape and curl_easy_unescape -unit1310 +unit1396 From a2e0ce86ba9246a6ba726eb77aa1ac0b01fc1fc0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 22 Jun 2013 22:24:36 +0200 Subject: [PATCH 4/5] KNOWN_BUGS: #83 unable to load non-default openssl engines --- docs/KNOWN_BUGS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS index e0308ffa6..87f186c67 100644 --- a/docs/KNOWN_BUGS +++ b/docs/KNOWN_BUGS @@ -3,6 +3,14 @@ join in and help us correct one or more of these! Also be sure to check the changelog of the current development status, as one or more of these problems may have been fixed since this was written! +83. curl is unable to load non-default openssl engines, because openssl isn't + initialized properly. This seems to require OpenSSL_config() or + CONF_modules_load_file() to be used by libcurl but the first seems to not + work and we've gotten not reports from tests with the latter. Possibly we + need to discuss with OpenSSL developers how this is supposed to be done. We + need users with actual external openssl engines for testing to work on this. + http://curl.haxx.se/bug/view.cgi?id=1208 + 82. When building with the Windows Borland compiler, it fails because the "tlib" tool doesn't support hyphens (minus signs) in file names and we have such in the build. From 7d80ed64e4351556d69dbfac73f5f579d5a9ebb2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 11 Mar 2013 00:39:52 +0100 Subject: [PATCH 5/5] SIGPIPE: ignored while inside the library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... and restore the ordinary handling again when it returns. This is done for curl_easy_perform() and curl_easy_cleanup() only for now - and only when built to use OpenSSL as backend as this is the known culprit for the spurious SIGPIPEs people have received. Bug: http://curl.haxx.se/bug/view.cgi?id=1180 Reported by: LluĂ­s Batlle i Rossell --- lib/easy.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/lib/easy.c b/lib/easy.c index 94a84abb2..32a887657 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -50,6 +50,11 @@ #include #endif +#if defined(HAVE_SIGNAL_H) && defined(HAVE_SIGACTION) && defined(USE_OPENSSL) +#define SIGPIPE_IGNORE 1 +#include +#endif + #include "strequal.h" #include "urldata.h" #include @@ -81,6 +86,49 @@ /* The last #include file should be: */ #include "memdebug.h" +#ifdef SIGPIPE_IGNORE +#define SIGPIPE_VARIABLE(x) struct sigaction x + +/* + * sigpipe_ignore() makes sure we ignore SIGPIPE while running libcurl + * internals, and then sigpipe_restore() will restore the situation when we + * return from libcurl again. + */ +static void sigpipe_ignore(struct SessionHandle *data, + struct sigaction *pipe) +{ + if(!data->set.no_signal) { + struct sigaction action; + /* first, extract the existing situation */ + sigaction(SIGPIPE, NULL, pipe); + action = *pipe; + /* ignore this signal */ + action.sa_handler = SIG_IGN; + sigaction(SIGPIPE, &action, NULL); + } +} + +/* + * sigpipe_restore() puts back the outside world's opinion of signal handler + * and SIGPIPE handling. It MUST only be called after a corresponding + * sigpipe_ignore() was used. + */ +static void sigpipe_restore(struct SessionHandle *data, + struct sigaction *pipe) +{ + if(!data->set.no_signal) { + /* restore the outside state */ + sigaction(SIGPIPE, pipe, NULL); + } +} + +#else +/* for systems without sigaction */ +#define sigpipe_ignore(x,y) +#define sigpipe_restore(x,y) +#define SIGPIPE_VARIABLE(x) +#endif + /* win32_cleanup() is for win32 socket cleanup functionality, the opposite of win32_init() */ static void win32_cleanup(void) @@ -423,6 +471,7 @@ CURLcode curl_easy_perform(CURL *easy) int without_fds = 0; /* count number of consecutive returns from curl_multi_wait() without any filedescriptors */ struct timeval before; + SIGPIPE_VARIABLE(pipe); if(!easy) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -455,6 +504,8 @@ CURLcode curl_easy_perform(CURL *easy) return CURLE_FAILED_INIT; } + sigpipe_ignore(data, &pipe); + /* assign this after curl_multi_add_handle() since that function checks for it and rejects this handle otherwise */ data->multi = multi; @@ -511,6 +562,8 @@ CURLcode curl_easy_perform(CURL *easy) a failure here, room for future improvement! */ (void)curl_multi_remove_handle(multi, easy); + sigpipe_restore(data, &pipe); + /* The multi handle is kept alive, owned by the easy handle */ return code; } @@ -522,11 +575,14 @@ CURLcode curl_easy_perform(CURL *easy) void curl_easy_cleanup(CURL *curl) { struct SessionHandle *data = (struct SessionHandle *)curl; + SIGPIPE_VARIABLE(pipe); if(!data) return; + sigpipe_ignore(data, &pipe); Curl_close(data); + sigpipe_restore(data, &pipe); } /*