fix gc issues
[m6w6/ext-http] / php_http_request_int.h
index ae6c125a46601a1fb5aeae5bc1d6fd30ba7cb49f..ed46b2317582e8eadcb311af500cfe72a94e4d80 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2006, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2007, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
 #              include <openssl/crypto.h>
 #      else /* !PHP_WIN32 */
 #              if defined(HTTP_HAVE_OPENSSL)
-#                      if defined(HAVE_OPENSSL_CRYPTO_H)
-#                              define HTTP_NEED_OPENSSL_TSL
-#                              include <openssl/crypto.h>
-#                      else
-#                              warning \
-                                       "libcurl was compiled with OpenSSL support, but configure could not find " \
-                                       "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
-                                       "cause random crashes on SSL requests"
-#                      endif
+#                      define HTTP_NEED_OPENSSL_TSL
+#                      include <openssl/crypto.h>
 #              elif defined(HTTP_HAVE_GNUTLS)
-#                      if defined(HAVE_GCRYPT_H)
-#                              define HTTP_NEED_GNUTLS_TSL
-#                              include <gcrypt.h>
-#                      else
-#                              warning \
-                                       "libcurl was compiled with GnuTLS support, but configure could not find " \
-                                       "gcrypt.h; thus no SSL crypto locking callbacks will be set, which may " \
-                                       "cause random crashes on SSL requests"
-#                      endif
+#                      define HTTP_NEED_GNUTLS_TSL
+#                      include <gcrypt.h>
 #              else
 #                      warning \
                                "libcurl was compiled with SSL support, but configure could not determine which" \
        }
 #define HTTP_CURL_OPT_STRING_EX(keyname, optname, obdc) \
        if (!strcasecmp(key.str, keyname)) { \
-               zval *copy = http_request_option_cache_ex(request, keyname, strlen(keyname)+1, 0, zval_copy(IS_STRING, *param)); \
+               zval *copy_tmp, *copy = http_request_option_cache_ex(request, keyname, strlen(keyname)+1, 0, convert_to_type_ex(IS_STRING, *param, &copy_tmp)); \
                if (obdc) { \
                        HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(copy), return FAILURE); \
                } \
                HTTP_CURL_OPT(optname, Z_STRVAL_P(copy)); \
+               if (copy_tmp) { \
+                       zval_ptr_dtor(&copy_tmp); \
+               } \
                continue; \
        }
 #define HTTP_CURL_OPT_LONG(OPTION, ldiff) \
        }
 #define HTTP_CURL_OPT_LONG_EX(keyname, optname) \
        if (!strcasecmp(key.str, keyname)) { \
-               zval *copy = zval_copy(IS_LONG, *param); \
+               zval *copy = *param; \
+               convert_to_long_ex(&copy); \
                HTTP_CURL_OPT(optname, Z_LVAL_P(copy)); \
-               zval_free(&copy); \
+               if (copy != *param) { \
+                       zval_ptr_dtor(&copy); \
+               } \
                continue; \
        }