Skip to content

Commit

Permalink
Fix zend_hash_clean assertion failure (#3634)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose authored Sep 7, 2020
1 parent 56f4f36 commit afd2a8c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions swoole_http_client_coro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -917,16 +917,8 @@ bool HttpClient::send() {

// when new request, clear all properties about the last response
{
zval *zattr;
zattr = sw_zend_read_property_ex(swoole_http_client_coro_ce, zobject, SW_ZSTR_KNOWN(SW_ZEND_STR_HEADERS), 0);
if (ZVAL_IS_ARRAY(zattr)) {
zend_hash_clean(Z_ARRVAL_P(zattr));
}
zattr = sw_zend_read_property_ex(
swoole_http_client_coro_ce, zobject, SW_ZSTR_KNOWN(SW_ZEND_STR_SET_COOKIE_HEADERS), 0);
if (ZVAL_IS_ARRAY(zattr)) {
zend_hash_clean(Z_ARRVAL_P(zattr));
}
zend_update_property_null(swoole_http_client_coro_ce, SW_Z8_OBJ_P(zobject), ZEND_STRL("headers"));
zend_update_property_null(swoole_http_client_coro_ce, SW_Z8_OBJ_P(zobject), ZEND_STRL("set_cookie_headers"));
zend_update_property_string(swoole_http_client_coro_ce, SW_Z8_OBJ_P(zobject), ZEND_STRL("body"), "");
}

Expand Down

0 comments on commit afd2a8c

Please sign in to comment.