2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
15 #if defined(ZTS) && defined(HTTP_HAVE_SSL)
17 # define HTTP_NEED_OPENSSL_TSL
18 # include <openssl/crypto.h>
19 # else /* !PHP_WIN32 */
20 # if defined(HTTP_HAVE_OPENSSL)
21 # if defined(HAVE_OPENSSL_CRYPTO_H)
22 # define HTTP_NEED_OPENSSL_TSL
23 # include <openssl/crypto.h>
26 "libcurl was compiled with OpenSSL support, but configure could not find " \
27 "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
28 "cause random crashes on SSL requests"
30 # elif defined(HTTP_HAVE_GNUTLS)
31 # if defined(HAVE_GCRYPT_H)
32 # define HTTP_NEED_GNUTLS_TSL
36 "libcurl was compiled with GnuTLS support, but configure could not find " \
37 "gcrypt.h; thus no SSL crypto locking callbacks will be set, which may " \
38 "cause random crashes on SSL requests"
42 "libcurl was compiled with SSL support, but configure could not determine which" \
43 "library was used; thus no SSL crypto locking callbacks will be set, which may " \
44 "cause random crashes on SSL requests"
45 # endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */
46 # endif /* PHP_WIN32 */
47 #endif /* ZTS && HTTP_HAVE_SSL */
49 #ifndef HAVE_CURL_EASY_STRERROR
50 # define curl_easy_strerror(dummy) "unknown error"
53 #define HTTP_CURL_OPT(OPTION, p) curl_easy_setopt((request->ch), OPTION, (p))
55 #define HTTP_CURL_OPT_STRING(OPTION, ldiff, obdc) \
58 HTTP_CURL_OPT_STRING_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION, obdc); \
60 #define HTTP_CURL_OPT_STRING_EX(keyname, optname, obdc) \
61 if (!strcasecmp(key.str, keyname)) { \
62 zval *copy = http_request_option_cache_ex(request, keyname, strlen(keyname)+1, 0, zval_copy(IS_STRING, *param)); \
64 HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(copy), return FAILURE); \
66 HTTP_CURL_OPT(optname, Z_STRVAL_P(copy)); \
69 #define HTTP_CURL_OPT_LONG(OPTION, ldiff) \
72 HTTP_CURL_OPT_LONG_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION); \
74 #define HTTP_CURL_OPT_LONG_EX(keyname, optname) \
75 if (!strcasecmp(key.str, keyname)) { \
76 zval *copy = zval_copy(IS_LONG, *param); \
77 HTTP_CURL_OPT(optname, Z_LVAL_P(copy)); \
87 * vim600: noet sw=4 ts=4 fdm=marker
88 * vim<600: noet sw=4 ts=4