/* advance message */
if (!old || old->type || zend_hash_num_elements(&old->hdrs)) {
- (*message) = php_http_message_init(NULL, 0, NULL TSRMLS_CC);
+ (*message) = php_http_message_init(NULL, 0, NULL);
(*message)->parent = old;
if (headers) {
(*headers) = &((*message)->hdrs);
static void php_http_message_object_prophandler_hash_dtor(zval *pData)
{
- efree(Z_PTR_P(pData));
+ pefree(Z_PTR_P(pData), 1);
}
typedef void (*php_http_message_object_prophandler_func_t)(php_http_message_object_t *o, zval *v);
PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
+ /* supplied retun_value lives on the stack of zend_read_property! */
+ return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, return_value);
+
if ((handler = php_http_message_object_get_prophandler(member_name))) {
+ zval_dtor(return_value);
+
if (type == BP_VAR_R) {
handler->read(obj, return_value);
} else {
php_property_proxy_t *proxy = php_property_proxy_init(object, member_name);
RETVAL_OBJ(&php_property_proxy_object_new_ex(php_property_proxy_get_class_entry(), proxy)->zo);
}
- } else {
- zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, return_value);
}
zend_string_release(member_name);
msg = php_http_message_parse(NULL, zs_msg->val, zs_msg->len, greedy);
if (!msg && !EG(exception)) {
- php_http_throw(bad_message, "Could not parse message: %.*s", MIN(25, zs_msg->len), zs_msg->len);
+ php_http_throw(bad_message, "Could not parse message: %.*s", MIN(25, zs_msg->len), zs_msg->val);
}
zend_string_release(zs_msg);
}
static PHP_METHOD(HttpMessage, setResponseStatus)
{
char *status;
- int status_len;
+ size_t status_len;
php_http_message_object_t *obj;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &status, &status_len), invalid_arg, return);
}
if (zboundary && boundary) {
+ ZVAL_DEREF(zboundary);
zval_dtor(zboundary);
ZVAL_STR(zboundary, php_http_cs2zs(boundary, strlen(boundary)));
}