|
|
92baa4 |
From ca7b1cd659eb0eb0ef355e3e122742abcea73287 Mon Sep 17 00:00:00 2001
|
|
|
92baa4 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
92baa4 |
Date: Wed, 2 Jul 2014 16:34:48 +0200
|
|
|
105fd7 |
Subject: [PATCH 1/3] tool: call PR_Cleanup() on exit if NSPR is used
|
|
|
92baa4 |
|
|
|
92baa4 |
This prevents valgrind from reporting possibly lost memory that NSPR
|
|
|
92baa4 |
uses for file descriptor cache and other globally allocated internal
|
|
|
92baa4 |
data structures.
|
|
|
92baa4 |
|
|
|
92baa4 |
Upstream-commit: 24c3cdce88f39731506c287cb276e8bf4a1ce393
|
|
|
92baa4 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
92baa4 |
---
|
|
|
92baa4 |
src/tool_main.c | 10 ++++++++++
|
|
|
92baa4 |
1 file changed, 10 insertions(+)
|
|
|
92baa4 |
|
|
|
92baa4 |
diff --git a/src/tool_main.c b/src/tool_main.c
|
|
|
92baa4 |
index 95e9cc7..6a1ed6c 100644
|
|
|
92baa4 |
--- a/src/tool_main.c
|
|
|
92baa4 |
+++ b/src/tool_main.c
|
|
|
92baa4 |
@@ -27,6 +27,10 @@
|
|
|
92baa4 |
#include <signal.h>
|
|
|
92baa4 |
#endif
|
|
|
92baa4 |
|
|
|
92baa4 |
+#ifdef USE_NSS
|
|
|
92baa4 |
+#include <nspr.h>
|
|
|
92baa4 |
+#endif
|
|
|
92baa4 |
+
|
|
|
92baa4 |
#define ENABLE_CURLX_PRINTF
|
|
|
92baa4 |
/* use our own printf() functions */
|
|
|
92baa4 |
#include "curlx.h"
|
|
|
92baa4 |
@@ -104,6 +108,12 @@ int main(int argc, char *argv[])
|
|
|
92baa4 |
tool_pressanykey();
|
|
|
92baa4 |
#endif
|
|
|
92baa4 |
|
|
|
92baa4 |
+#ifdef USE_NSS
|
|
|
92baa4 |
+ if(PR_Initialized())
|
|
|
92baa4 |
+ /* prevent valgrind from reporting possibly lost memory (fd cache, ...) */
|
|
|
92baa4 |
+ PR_Cleanup();
|
|
|
92baa4 |
+#endif
|
|
|
92baa4 |
+
|
|
|
92baa4 |
free_config_fields(&config);
|
|
|
92baa4 |
|
|
|
92baa4 |
#ifdef __NOVELL_LIBC__
|
|
|
92baa4 |
--
|
|
|
92baa4 |
2.1.0
|
|
|
92baa4 |
|
|
|
92baa4 |
|
|
|
92baa4 |
From 295471f8122cf6522c36f8e3588e5b4d15a691ea Mon Sep 17 00:00:00 2001
|
|
|
92baa4 |
From: Alessandro Ghedini <alessandro@ghedini.me>
|
|
|
92baa4 |
Date: Thu, 17 Jul 2014 14:37:28 +0200
|
|
|
105fd7 |
Subject: [PATCH 2/3] build: link curl to NSS libraries when NSS support is
|
|
|
92baa4 |
enabled
|
|
|
92baa4 |
|
|
|
92baa4 |
This fixes a build failure on Debian caused by commit
|
|
|
92baa4 |
24c3cdce88f39731506c287cb276e8bf4a1ce393.
|
|
|
92baa4 |
|
|
|
92baa4 |
Bug: http://curl.haxx.se/mail/lib-2014-07/0209.html
|
|
|
92baa4 |
|
|
|
92baa4 |
Upstream-commit: c6e7cbb94e669b85d3eb8e015ec51d0072112133
|
|
|
92baa4 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
92baa4 |
---
|
|
|
92baa4 |
configure | 5 ++++-
|
|
|
92baa4 |
configure.ac | 4 ++++
|
|
|
92baa4 |
src/Makefile.am | 2 +-
|
|
|
92baa4 |
src/Makefile.in | 3 ++-
|
|
|
92baa4 |
4 files changed, 11 insertions(+), 3 deletions(-)
|
|
|
92baa4 |
|
|
|
92baa4 |
diff --git a/configure b/configure
|
|
|
92baa4 |
index 8741e21..c5d1817 100755
|
|
|
92baa4 |
--- a/configure
|
|
|
92baa4 |
+++ b/configure
|
|
|
92baa4 |
@@ -913,7 +913,7 @@ LIBMETALINK_LIBS
|
|
|
92baa4 |
CURL_CA_BUNDLE
|
|
|
92baa4 |
SSL_ENABLED
|
|
|
92baa4 |
USE_AXTLS
|
|
|
92baa4 |
-HAVE_NSS_INITCONTEXT
|
|
|
92baa4 |
+NSS_LIBS
|
|
|
92baa4 |
USE_NSS
|
|
|
92baa4 |
USE_CYASSL
|
|
|
92baa4 |
USE_POLARSSL
|
|
|
92baa4 |
@@ -23697,6 +23697,9 @@ fi
|
|
|
92baa4 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: detected NSS version $version" >&5
|
|
|
92baa4 |
$as_echo "$as_me: detected NSS version $version" >&6;}
|
|
|
92baa4 |
|
|
|
92baa4 |
+ NSS_LIBS=$addlib
|
|
|
92baa4 |
+
|
|
|
92baa4 |
+
|
|
|
92baa4 |
if test "x$cross_compiling" != "xyes"; then
|
|
|
92baa4 |
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
|
|
|
92baa4 |
export LD_LIBRARY_PATH
|
|
|
92baa4 |
diff --git a/configure.ac b/configure.ac
|
|
|
92baa4 |
index 70ef0b7..60a6b58 100644
|
|
|
92baa4 |
--- a/configure.ac
|
|
|
92baa4 |
+++ b/configure.ac
|
|
|
92baa4 |
@@ -2211,6 +2211,10 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
|
|
92baa4 |
if test "x$USE_NSS" = "xyes"; then
|
|
|
92baa4 |
AC_MSG_NOTICE([detected NSS version $version])
|
|
|
92baa4 |
|
|
|
92baa4 |
+ dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
|
|
|
92baa4 |
+ NSS_LIBS=$addlib
|
|
|
92baa4 |
+ AC_SUBST([NSS_LIBS])
|
|
|
92baa4 |
+
|
|
|
92baa4 |
dnl when shared libs were found in a path that the run-time
|
|
|
92baa4 |
dnl linker doesn't search through, we need to add it to
|
|
|
92baa4 |
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
|
|
92baa4 |
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
|
92baa4 |
index af5a488..6863078 100644
|
|
|
92baa4 |
--- a/src/Makefile.am
|
|
|
92baa4 |
+++ b/src/Makefile.am
|
|
|
92baa4 |
@@ -60,7 +60,7 @@ LIBS = $(BLANK_AT_MAKETIME)
|
|
|
92baa4 |
if USE_EXPLICIT_LIB_DEPS
|
|
|
92baa4 |
curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
|
|
|
92baa4 |
else
|
|
|
92baa4 |
-curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
|
|
|
92baa4 |
+curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
|
|
|
92baa4 |
endif
|
|
|
92baa4 |
|
|
|
92baa4 |
curl_LDFLAGS = @LIBMETALINK_LDFLAGS@
|
|
|
92baa4 |
diff --git a/src/Makefile.in b/src/Makefile.in
|
|
|
92baa4 |
index 41fb549..1b578c2 100644
|
|
|
92baa4 |
--- a/src/Makefile.in
|
|
|
92baa4 |
+++ b/src/Makefile.in
|
|
|
92baa4 |
@@ -231,6 +231,7 @@ NMEDIT = @NMEDIT@
|
|
|
92baa4 |
# Use the C locale to ensure that only ASCII characters appear in the
|
|
|
92baa4 |
# embedded text.
|
|
|
92baa4 |
NROFF = env LC_ALL=C @NROFF@ @MANOPT@ # figured out by the configure script
|
|
|
92baa4 |
+NSS_LIBS = @NSS_LIBS@
|
|
|
92baa4 |
OBJDUMP = @OBJDUMP@
|
|
|
92baa4 |
OBJEXT = @OBJEXT@
|
|
|
92baa4 |
OTOOL = @OTOOL@
|
|
|
92baa4 |
@@ -463,7 +464,7 @@ CURL_HFILES = \
|
|
|
92baa4 |
tool_xattr.h
|
|
|
92baa4 |
|
|
|
92baa4 |
curl_SOURCES = $(CURL_CFILES) $(CURLX_ONES) $(CURL_HFILES)
|
|
|
92baa4 |
-@USE_EXPLICIT_LIB_DEPS_FALSE@curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
|
|
|
92baa4 |
+@USE_EXPLICIT_LIB_DEPS_FALSE@curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
|
|
|
92baa4 |
@USE_EXPLICIT_LIB_DEPS_TRUE@curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
|
|
|
92baa4 |
curl_LDFLAGS = @LIBMETALINK_LDFLAGS@
|
|
|
92baa4 |
curl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMETALINK_CPPFLAGS)
|
|
|
92baa4 |
--
|
|
|
92baa4 |
2.1.0
|
|
|
92baa4 |
|
|
|
105fd7 |
|
|
|
105fd7 |
From 0631da3859c9868ff317521544a246b5be83e600 Mon Sep 17 00:00:00 2001
|
|
|
105fd7 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
105fd7 |
Date: Tue, 14 Jul 2015 17:08:44 +0200
|
|
|
105fd7 |
Subject: [PATCH 3/3] libtest: call PR_Cleanup() on exit if NSPR is used
|
|
|
105fd7 |
MIME-Version: 1.0
|
|
|
105fd7 |
Content-Type: text/plain; charset=UTF-8
|
|
|
105fd7 |
Content-Transfer-Encoding: 8bit
|
|
|
105fd7 |
|
|
|
105fd7 |
This prevents valgrind from reporting possibly lost memory that NSPR
|
|
|
105fd7 |
uses for file descriptor cache and other globally allocated internal
|
|
|
105fd7 |
data structures.
|
|
|
105fd7 |
|
|
|
105fd7 |
Reported-by: Štefan Kremeň
|
|
|
105fd7 |
|
|
|
105fd7 |
Upstream-commit: cd20e81e89ecebc5064e1d3e22e62e2802b2711e
|
|
|
105fd7 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
105fd7 |
---
|
|
|
105fd7 |
tests/libtest/Makefile.am | 4 ++--
|
|
|
105fd7 |
tests/libtest/Makefile.in | 4 ++--
|
|
|
105fd7 |
tests/libtest/first.c | 15 ++++++++++++++-
|
|
|
105fd7 |
3 files changed, 18 insertions(+), 5 deletions(-)
|
|
|
105fd7 |
|
|
|
105fd7 |
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
|
|
|
105fd7 |
index ba4097f..a844ab2 100644
|
|
|
105fd7 |
--- a/tests/libtest/Makefile.am
|
|
|
105fd7 |
+++ b/tests/libtest/Makefile.am
|
|
|
105fd7 |
@@ -62,8 +62,8 @@ if USE_EXPLICIT_LIB_DEPS
|
|
|
105fd7 |
SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
|
|
|
105fd7 |
TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
|
|
|
105fd7 |
else
|
|
|
105fd7 |
-SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_LIBS@
|
|
|
105fd7 |
-TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_AND_TIME_LIBS@
|
|
|
105fd7 |
+SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_LIBS@ @NSS_LIBS@
|
|
|
105fd7 |
+TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_AND_TIME_LIBS@ @NSS_LIBS@
|
|
|
105fd7 |
endif
|
|
|
105fd7 |
|
|
|
105fd7 |
# Dependencies (may need to be overriden)
|
|
|
105fd7 |
diff --git a/tests/libtest/Makefile.in b/tests/libtest/Makefile.in
|
|
|
105fd7 |
index e6826c0..9086af3 100644
|
|
|
105fd7 |
--- a/tests/libtest/Makefile.in
|
|
|
105fd7 |
+++ b/tests/libtest/Makefile.in
|
|
|
105fd7 |
@@ -949,9 +949,9 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
|
|
105fd7 |
EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl \
|
|
|
105fd7 |
test1022.pl Makefile.inc notexists.pl
|
|
|
105fd7 |
|
|
|
105fd7 |
-@USE_EXPLICIT_LIB_DEPS_FALSE@SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_LIBS@
|
|
|
105fd7 |
+@USE_EXPLICIT_LIB_DEPS_FALSE@SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_LIBS@ @NSS_LIBS@
|
|
|
105fd7 |
@USE_EXPLICIT_LIB_DEPS_TRUE@SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
|
|
|
105fd7 |
-@USE_EXPLICIT_LIB_DEPS_FALSE@TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_AND_TIME_LIBS@
|
|
|
105fd7 |
+@USE_EXPLICIT_LIB_DEPS_FALSE@TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_AND_TIME_LIBS@ @NSS_LIBS@
|
|
|
105fd7 |
@USE_EXPLICIT_LIB_DEPS_TRUE@TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
|
|
|
105fd7 |
|
|
|
105fd7 |
# Dependencies (may need to be overriden)
|
|
|
105fd7 |
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
|
|
|
105fd7 |
index 253acb2..94748a5 100644
|
|
|
105fd7 |
--- a/tests/libtest/first.c
|
|
|
105fd7 |
+++ b/tests/libtest/first.c
|
|
|
105fd7 |
@@ -25,6 +25,10 @@
|
|
|
105fd7 |
#include <locale.h> /* for setlocale() */
|
|
|
105fd7 |
#endif
|
|
|
105fd7 |
|
|
|
105fd7 |
+#ifdef USE_NSS
|
|
|
105fd7 |
+#include <nspr.h>
|
|
|
105fd7 |
+#endif
|
|
|
105fd7 |
+
|
|
|
105fd7 |
#ifdef CURLDEBUG
|
|
|
105fd7 |
# define MEMDEBUG_NODEFINES
|
|
|
105fd7 |
# include "memdebug.h"
|
|
|
105fd7 |
@@ -97,6 +101,7 @@ static void memory_tracking_init(void)
|
|
|
105fd7 |
int main(int argc, char **argv)
|
|
|
105fd7 |
{
|
|
|
105fd7 |
char *URL;
|
|
|
105fd7 |
+ int result;
|
|
|
105fd7 |
|
|
|
105fd7 |
memory_tracking_init();
|
|
|
105fd7 |
|
|
|
105fd7 |
@@ -127,5 +132,13 @@ int main(int argc, char **argv)
|
|
|
105fd7 |
|
|
|
105fd7 |
fprintf(stderr, "URL: %s\n", URL);
|
|
|
105fd7 |
|
|
|
105fd7 |
- return test(URL);
|
|
|
105fd7 |
+ result = test(URL);
|
|
|
105fd7 |
+
|
|
|
105fd7 |
+#ifdef USE_NSS
|
|
|
105fd7 |
+ if(PR_Initialized())
|
|
|
105fd7 |
+ /* prevent valgrind from reporting possibly lost memory (fd cache, ...) */
|
|
|
105fd7 |
+ PR_Cleanup();
|
|
|
105fd7 |
+#endif
|
|
|
105fd7 |
+
|
|
|
105fd7 |
+ return result;
|
|
|
105fd7 |
}
|
|
|
105fd7 |
--
|
|
|
105fd7 |
2.4.3
|
|
|
105fd7 |
|