- MAKE_STD_ZVAL(info);
- array_init(info);
- http_request_info(obj->request, Z_ARRVAL_P(info));
- SET_PROP(obj, responseInfo, info);
- zval_ptr_dtor(&info);
-
- return SUCCESS;
+ ret = SUCCESS;
+ } else {
+ /* update properties with empty values*/
+ zval *resp = GET_PROP(responseData), *znull;
+
+ MAKE_STD_ZVAL(znull);
+ ZVAL_NULL(znull);
+ SET_PROP(responseMessage, znull);
+ zval_ptr_dtor(&znull);
+
+ if (Z_TYPE_P(resp) == IS_ARRAY) {
+ zend_hash_clean(Z_ARRVAL_P(resp));
+ }
+
+ UPD_PROP(long, responseCode, 0);
+ UPD_PROP(string, responseStatus, "");
+
+ /* append request message to history */
+ if (zval_is_true(GET_PROP(recordHistory))) {
+ http_message *request;
+
+ if ((request = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) {
+ zval *hist, *history = GET_PROP(history);
+
+ MAKE_STD_ZVAL(hist);
+ ZVAL_OBJVAL(hist, http_message_object_new_ex(http_message_object_ce, request, NULL), 0);
+ if (Z_TYPE_P(history) == IS_OBJECT) {
+ http_message_object_prepend(hist, history);
+ }
+ SET_PROP(history, hist);
+ zval_ptr_dtor(&hist);
+ }
+ }
+
+ ret = FAILURE;