- cleanup
[m6w6/ext-http] / http_request_object.c
index 047e2a34c13cda697627693b43636e017bd37bbc..1d04ed119e39a4248cd8fcd28f6e2fb64a9c899c 100644 (file)
@@ -409,7 +409,7 @@ zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, ht
        }
 
        ALLOC_HASHTABLE(OBJ_PROP(o));
-       zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
        zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
 
        ov.handle = putObject(http_request_object, o);
@@ -633,7 +633,7 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this
                }
 
                UPD_PROP(long, responseCode, msg->http.info.response.code);
-               UPD_PROP(string, responseStatus, msg->http.info.response.status);
+               UPD_PROP(string, responseStatus, msg->http.info.response.status ? msg->http.info.response.status : "");
 
                MAKE_STD_ZVAL(resp);
                array_init(resp);