aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-23 11:44:23 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-23 11:44:23 +0000
commit1d7f9db03714a7694ad0ab6aa386f196ef539ac6 (patch)
treebff23c2efff21c6a7f1c969d2ee47f6bf60c5f04
parent3a015cd331f0a88425670fb2c6361875df10229d (diff)
downloadlibmicrohttpd-1d7f9db03714a7694ad0ab6aa386f196ef539ac6.tar.gz
libmicrohttpd-1d7f9db03714a7694ad0ab6aa386f196ef539ac6.zip
-need to initialize gcrypt for libcurl
-rw-r--r--src/testcurl/Makefile.am4
-rw-r--r--src/testcurl/test_digestauth.c11
-rw-r--r--src/testcurl/test_digestauth_with_arguments.c10
3 files changed, 21 insertions, 4 deletions
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index 290e0c49..91a6df0c 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -127,13 +127,13 @@ test_digestauth_SOURCES = \
127 test_digestauth.c 127 test_digestauth.c
128test_digestauth_LDADD = \ 128test_digestauth_LDADD = \
129 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 129 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
130 @LIBCURL@ 130 @LIBCURL@ @LIBGCRYPT_LIBS@
131 131
132test_digestauth_with_arguments_SOURCES = \ 132test_digestauth_with_arguments_SOURCES = \
133 test_digestauth_with_arguments.c 133 test_digestauth_with_arguments.c
134test_digestauth_with_arguments_LDADD = \ 134test_digestauth_with_arguments_LDADD = \
135 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 135 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
136 @LIBCURL@ 136 @LIBCURL@ @LIBGCRYPT_LIBS@
137 137
138test_get_sendfile_SOURCES = \ 138test_get_sendfile_SOURCES = \
139 test_get_sendfile.c 139 test_get_sendfile.c
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c
index 878ae653..d6c145f1 100644
--- a/src/testcurl/test_digestauth.c
+++ b/src/testcurl/test_digestauth.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include <gcrypt.h>
34 35
35#ifndef WINDOWS 36#ifndef WINDOWS
36#include <sys/socket.h> 37#include <sys/socket.h>
@@ -221,12 +222,20 @@ testDigestAuth ()
221 return 0; 222 return 0;
222} 223}
223 224
225GCRY_THREAD_OPTION_PTHREAD_IMPL;
226
227
224int 228int
225main (int argc, char *const *argv) 229main (int argc, char *const *argv)
226{ 230{
227 unsigned int errorCount = 0; 231 unsigned int errorCount = 0;
228 232
229 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 233 gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
234 gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
235#ifdef GCRYCTL_INITIALIZATION_FINISHED
236 gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
237#endif
238if (0 != curl_global_init (CURL_GLOBAL_WIN32))
230 return 2; 239 return 2;
231 errorCount += testDigestAuth (); 240 errorCount += testDigestAuth ();
232 if (errorCount != 0) 241 if (errorCount != 0)
diff --git a/src/testcurl/test_digestauth_with_arguments.c b/src/testcurl/test_digestauth_with_arguments.c
index 04227823..f7757552 100644
--- a/src/testcurl/test_digestauth_with_arguments.c
+++ b/src/testcurl/test_digestauth_with_arguments.c
@@ -23,7 +23,6 @@
23 * @brief Testcase for libmicrohttpd Digest Auth with arguments 23 * @brief Testcase for libmicrohttpd Digest Auth with arguments
24 * @author Amr Ali 24 * @author Amr Ali
25 */ 25 */
26
27#include "MHD_config.h" 26#include "MHD_config.h"
28#include "platform.h" 27#include "platform.h"
29#include <curl/curl.h> 28#include <curl/curl.h>
@@ -31,6 +30,7 @@
31#include <stdlib.h> 30#include <stdlib.h>
32#include <string.h> 31#include <string.h>
33#include <time.h> 32#include <time.h>
33#include <gcrypt.h>
34 34
35#ifndef WINDOWS 35#ifndef WINDOWS
36#include <sys/socket.h> 36#include <sys/socket.h>
@@ -221,11 +221,19 @@ testDigestAuth ()
221 return 0; 221 return 0;
222} 222}
223 223
224
225GCRY_THREAD_OPTION_PTHREAD_IMPL;
226
227
224int 228int
225main (int argc, char *const *argv) 229main (int argc, char *const *argv)
226{ 230{
227 unsigned int errorCount = 0; 231 unsigned int errorCount = 0;
228 232
233 gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
234 gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
235#ifdef GCRYCTL_INITIALIZATION_FINISHED
236 gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
229 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 237 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
230 return 2; 238 return 2;
231 errorCount += testDigestAuth (); 239 errorCount += testDigestAuth ();