- /* request completed? */
- if (Z_TYPE_P(info) == IS_ARRAY) {
- if (info_len && info_name) {
- if (SUCCESS == zend_symtable_find(Z_ARRVAL_P(info), php_http_pretty_key(info_name, info_len, 0, 0), info_len + 1, (void *) &infop)) {
- RETURN_ZVAL(*infop, 1, 0);
- } else {
- php_http_error(HE_NOTICE, PHP_HTTP_E_INVALID_PARAM, "Could not find transfer info named %s", info_name);
- }
- } else {
- RETURN_ZVAL(info, 1, 0);
- }
+ info = zend_read_property(php_http_client_response_class_entry, getThis(), ZEND_STRL("transferInfo"), 0 TSRMLS_CC);
+
+ /* request completed? */
+ if (Z_TYPE_P(info) != IS_OBJECT) {
+ php_http_throw(bad_method_call, "Incomplete state", NULL);
+ return;
+ }
+
+ if (info_len && info_name) {
+ info = zend_read_property(NULL, info, php_http_pretty_key(info_name, info_len, 0, 0), info_len, 0 TSRMLS_CC);
+
+ if (!info) {
+ php_http_throw(unexpected_val, "Could not find transfer info with name '%s'", info_name);
+ return;