#ifdef HTTP_HAVE_PERSISTENT_HANDLES
PHP_INI_MH(http_update_persistent_handle_ident)
{
- HTTP_G->persistent.handles.ident.h = zend_get_hash_value(new_value, HTTP_G->persistent.handles.ident.l = new_value_length+1);
+ HTTP_G->persistent.handles.ident.h = zend_hash_func(new_value, HTTP_G->persistent.handles.ident.l = new_value_length+1);
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
}
#endif
#ifdef HTTP_HAVE_CURL
# ifdef HTTP_HAVE_PERSISTENT_HANDLES
(SUCCESS != PHP_MINIT_CALL(http_persistent_handle)) ||
+# ifdef ZEND_ENGINE_2
(SUCCESS != PHP_MINIT_CALL(http_request_pool)) ||
+# endif
# endif
(SUCCESS != PHP_MINIT_CALL(http_request)) ||
# ifdef ZEND_ENGINE_2
http_message *msg = obj->message;
zval *return_value;
#ifdef WONKY
- ulong h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member)+1);
+ ulong h = zend_hash_func(Z_STRVAL_P(member), Z_STRLEN_P(member)+1);
#else
zend_property_info *pinfo = zend_get_property_info(obj->zo.ce, member, 1 TSRMLS_CC);
http_message *msg = obj->message;
zval *cpy = NULL;
#ifdef WONKY
- ulong h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
+ ulong h = zend_hash_func(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
#else
zend_property_info *pinfo = zend_get_property_info(obj->zo.ce, member, 1 TSRMLS_CC);
/* {{{ static inline zval *http_request_option(http_request *, HashTable *, char *, size_t, int) */
static inline zval *_http_request_option_ex(http_request *r, HashTable *options, char *key, size_t keylen, int type TSRMLS_DC)
{
- zval **zoption;
-#ifdef ZEND_ENGINE_2
- ulong h = zend_get_hash_value(key, keylen);
-#else
- ulong h = 0;
-#endif
-
- if (!options ||
-#ifdef ZEND_ENGINE_2
- (SUCCESS != zend_hash_quick_find(options, key, keylen, h, (void *) &zoption))
-#else
- (SUCCESS != zend_hash_find(options, key, keylen, (void *) &zoption))
-#endif
- ) {
- return NULL;
+ if (options) {
+ zval **zoption;
+ ulong h = zend_hash_func(key, keylen);
+
+ if (SUCCESS == zend_hash_quick_find(options, key, keylen, h, (void *) &zoption)) {
+ return http_request_option_cache_ex(r, key, keylen, h, zval_copy(type, *zoption));
+ }
}
- return http_request_option_cache_ex(r, key, keylen, h, zval_copy(type, *zoption));
+ return NULL;
}
/* }}} */
{
ZVAL_ADDREF(opt);
-#ifdef ZEND_ENGINE_2
if (h) {
- _zend_hash_quick_add_or_update(&r->_cache.options, key, keylen, h, &opt, sizeof(zval *), NULL,
- zend_hash_quick_exists(&r->_cache.options, key, keylen, h)?HASH_UPDATE:HASH_ADD ZEND_FILE_LINE_CC);
- }
- else
-#endif
- {
- if (zend_hash_exists(&r->_cache.options, key, keylen)) {
- zend_hash_update(&r->_cache.options, key, keylen, &opt, sizeof(zval *), NULL);
- } else {
- zend_hash_add(&r->_cache.options, key, keylen, &opt, sizeof(zval *), NULL);
- }
+ zend_hash_quick_update(&r->_cache.options, key, keylen, h, &opt, sizeof(zval *), NULL);
+ } else {
+ zend_hash_update(&r->_cache.options, key, keylen, &opt, sizeof(zval *), NULL);
}
return opt;
static int apply_pretty_key(void *pDest, int num_args, va_list args, zend_hash_key *hash_key)
{
if (hash_key->nKeyLength > 1) {
- hash_key->h = zend_get_hash_value(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength);
+ hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength);
}
return ZEND_HASH_APPLY_KEEP;
}
#ifndef _PHPSTR_H_
#define _PHPSTR_H_
-#include "php.h"
-
#ifndef PHPSTR_DEFAULT_SIZE
# define PHPSTR_DEFAULT_SIZE 256
#endif
#ifndef pemalloc
# define pemalloc(s,p) malloc(s)
# define pefree(x,p) free(x)
-# define perealloc(x,s,p) erealloc(x,s)
+# define perealloc(x,s,p) realloc(x,s)
# define perealloc_recoverable perealloc
+# define ecalloc calloc
+static inline void *estrndup(void *p, size_t s)
+{
+ char *r = (char *) malloc(s+1);
+ if (r) memcpy((void *) r, p, s), r[s] = '\0';
+ return (void *) r;
+}
#endif
#if defined(PHP_WIN32)