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-2007, 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 # define HTTP_NEED_OPENSSL_TSL
22 # include <openssl/crypto.h>
23 # elif defined(HTTP_HAVE_GNUTLS)
24 # define HTTP_NEED_GNUTLS_TSL
28 "libcurl was compiled with SSL support, but configure could not determine which" \
29 "library was used; thus no SSL crypto locking callbacks will be set, which may " \
30 "cause random crashes on SSL requests"
31 # endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */
32 # endif /* PHP_WIN32 */
33 #endif /* ZTS && HTTP_HAVE_SSL */
35 #define HTTP_CURL_OPT(OPTION, p) curl_easy_setopt((request->ch), OPTION, (p))
37 #define HTTP_CURL_OPT_STRING(OPTION, ldiff, obdc) \
40 HTTP_CURL_OPT_STRING_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION, obdc); \
42 #define HTTP_CURL_OPT_STRING_EX(keyname, optname, obdc) \
43 if (!strcasecmp(key.str, keyname)) { \
44 zval *copy = http_request_option_cache_ex(request, keyname, strlen(keyname)+1, 0, http_zsep(IS_STRING, *param)); \
46 HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(copy), return FAILURE); \
48 HTTP_CURL_OPT(optname, Z_STRVAL_P(copy)); \
49 zval_ptr_dtor(©); \
52 #define HTTP_CURL_OPT_LONG(OPTION, ldiff) \
55 HTTP_CURL_OPT_LONG_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION); \
57 #define HTTP_CURL_OPT_LONG_EX(keyname, optname) \
58 if (!strcasecmp(key.str, keyname)) { \
59 zval *copy = http_zsep(IS_LONG, *param); \
60 HTTP_CURL_OPT(optname, Z_LVAL_P(copy)); \
61 zval_ptr_dtor(©); \
70 * vim600: noet sw=4 ts=4 fdm=marker
71 * vim<600: noet sw=4 ts=4