X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_object.c;h=43cf5a805ea0660905d66367f33493d81711383f;hp=73d3718394848ecf3f4ff50aae370110dd86e0a9;hb=1ad65c598ee022aa7b31bb0884fe15b3dcd454d3;hpb=0e41acb9661b95484c212e349f83e34eb3fe84a2 diff --git a/http_request_object.c b/http_request_object.c index 73d3718..43cf5a8 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -1894,7 +1894,7 @@ PHP_METHOD(HttpRequest, getRequestMessage) getObject(http_request_object, obj); SET_EH_THROW_HTTP(); - if (msg = http_message_parse(PHPSTR_VAL(&obj->request), PHPSTR_LEN(&obj->request))) { + if ((msg = http_message_parse(PHPSTR_VAL(&obj->request), PHPSTR_LEN(&obj->request)))) { ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL)); } SET_EH_NORMAL(); @@ -1930,7 +1930,7 @@ PHP_METHOD(HttpRequest, getHistory) getObject(http_request_object, obj); SET_EH_THROW_HTTP(); - if (msg = http_message_parse(PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history))) { + if ((msg = http_message_parse(PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history)))) { ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL)); } SET_EH_NORMAL(); @@ -1957,6 +1957,10 @@ PHP_METHOD(HttpRequest, clearHistory) * * Returns the received response as HttpMessage object. * + * NOTE: While an exception may be thrown, the transfer could have succeeded + * at least partially, so you might want to check the return values of various + * HttpRequest::getResponse*() methods. + * * Throws HttpRuntimeException, HttpRequestException, * HttpMalformedHeaderException, HttpEncodingException. *