Merge branch 'master' into phpng
[m6w6/ext-http] / php_http_misc.h
index 32f2bc5d2ee0da75892b2892648315421184db39..36f4020359877a501068eaa5dc359d67ed538b0c 100644 (file)
@@ -27,6 +27,9 @@
 /* send buffer size */
 #define PHP_HTTP_SENDBUF_SIZE 40960
 
+/* allowed characters of header field names */
+#define PHP_HTTP_HEADER_NAME_CHARS "!#$%&'*+-.^_`|~1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
 /* SLEEP */
 
 #define PHP_HTTP_DIFFSEC (0.001)
@@ -136,6 +139,11 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i
 
 /* ZEND */
 
+#ifdef PHP_DEBUG
+#      undef  HASH_OF
+#      define HASH_OF(p) ((HashTable*)(Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p)) : NULL))))
+#endif
+
 static inline void *PHP_HTTP_OBJ(zend_object *zo, zval *zv)
 {
        if (!zo) {
@@ -225,7 +233,7 @@ static inline void *php_http_arrkey_stringify(php_http_arrkey_t *arrkey, zend_ha
        }
 
        if (key) {
-               memcpy(&arrkey, key, sizeof(*key));
+               memcpy(arrkey, key, sizeof(*key));
        }
        if ((arrkey->stringified = !arrkey->key)) {
                arrkey->key = zend_long_to_str(arrkey->h);