projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- add missing support for raw post data (HttpRequest)
[m6w6/ext-http]
/
http.c
diff --git
a/http.c
b/http.c
index 02a789adab5ba688710065a576f9faa6fd468d10..a174960db9ff46d018feda0ffb76ab67a1b795a4 100644
(file)
--- a/
http.c
+++ b/
http.c
@@
-52,6
+52,14
@@
#include "phpstr/phpstr.h"
#ifdef HTTP_HAVE_CURL
#include "phpstr/phpstr.h"
#ifdef HTTP_HAVE_CURL
+# if defined(ZTS) && defined(HTTP_HAVE_SSL)
+# if !defined(HAVE_OPENSSL_CRYPTO_H)
+# error "libcurl was compiled with OpenSSL support, but we have no crypto.h"
+# else
+# define HTTP_NEED_SSL
+# include <openssl/crypto.h>
+# endif
+# endif
# ifdef PHP_WIN32
# include <winsock2.h>
# endif
# ifdef PHP_WIN32
# include <winsock2.h>
# endif
@@
-251,9
+259,7
@@
PHP_INI_END()
/* }}} */
/* {{{ SSL */
/* }}} */
/* {{{ SSL */
-#if defined(ZTS) && defined(HTTP_HAVE_CURL) && defined(HAVE_OPENSSL_CRYPTO_H)
-
-#include <openssl/crypto.h>
+#ifdef HTTP_NEED_SSL
static MUTEX_T *http_ssl_mutex = NULL;
static MUTEX_T *http_ssl_mutex = NULL;
@@
-291,6
+297,9
@@
static inline void http_ssl_cleanup(void)
for (i = 0; i < c; ++i) {
tsrm_mutex_free(http_ssl_mutex[i]);
}
for (i = 0; i < c; ++i) {
tsrm_mutex_free(http_ssl_mutex[i]);
}
+
+ free(http_ssl_mutex);
+ http_ssl_mutex = NULL;
}
#endif
/* }}} */
}
#endif
/* }}} */
@@
-310,7
+319,7
@@
PHP_MINIT_FUNCTION(http)
#ifdef HTTP_HAVE_CURL
if (CURLE_OK == curl_global_init(CURL_GLOBAL_ALL)) {
#ifdef HTTP_HAVE_CURL
if (CURLE_OK == curl_global_init(CURL_GLOBAL_ALL)) {
-# if
defined(ZTS) && defined(HAVE_OPENSSL_CRYPTO_H)
+# if
def HTTP_NEED_SSL
curl_version_info_data *cvid = curl_version_info(CURLVERSION_NOW);
if (cvid && (cvid->features & CURL_VERSION_SSL)) {
http_ssl_init();
curl_version_info_data *cvid = curl_version_info(CURLVERSION_NOW);
if (cvid && (cvid->features & CURL_VERSION_SSL)) {
http_ssl_init();
@@
-344,7
+353,7
@@
PHP_MSHUTDOWN_FUNCTION(http)
UNREGISTER_INI_ENTRIES();
#ifdef HTTP_HAVE_CURL
curl_global_cleanup();
UNREGISTER_INI_ENTRIES();
#ifdef HTTP_HAVE_CURL
curl_global_cleanup();
-# if
defined(ZTS) && defined(HAVE_OPENSSL_CRYPTO_H)
+# if
def HTTP_NEED_SSL
if (http_ssl_mutex) {
http_ssl_cleanup();
}
if (http_ssl_mutex) {
http_ssl_cleanup();
}