X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=http_request_object.c;h=fbddcc6ec8e470e5f5254b19fe70d91f9ae86db2;hb=562c9941215d5080452fd8686dba6c408cb8ddda;hp=76ba2dd1d2eefc300562f16796701f3c7c9e1ae9;hpb=8cba9d81560b60079a53241b3f906e9dff50196e;p=m6w6%2Fext-http diff --git a/http_request_object.c b/http_request_object.c index 76ba2dd..fbddcc6 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -1874,6 +1874,13 @@ PHP_METHOD(HttpRequest, getResponseMessage) * references the last received response. Use HttpMessage::getParentMessage() * to access the data of previously sent requests whithin this request * cycle. + * + * Note that the internal request message is immutable, that means that the + * request message received through HttpRequest::getRequestMessage() will + * always look the same for the same request, regardless of any changes you + * may have made to the returned object. + * + * Throws HttpMalformedHeadersException, HttpEncodingException. */ PHP_METHOD(HttpRequest, getRequestMessage) { @@ -1885,7 +1892,7 @@ PHP_METHOD(HttpRequest, getRequestMessage) SET_EH_THROW_HTTP(); if (msg = http_message_parse(PHPSTR_VAL(&obj->request), PHPSTR_LEN(&obj->request))) { - RETVAL_OBJVAL(http_message_object_new_ex(http_message_object_ce, msg, NULL)); + ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL)); } SET_EH_NORMAL(); } @@ -1905,7 +1912,11 @@ PHP_METHOD(HttpRequest, getRequestMessage) * The object references the last received response, use HttpMessage::getParentMessage() * to access the data of previously sent requests and received responses. * - * Throws HttpMalformedHeaderException. + * Note that the internal history is immutable, that means that any changes + * you make the the message list won't affect a history message list newly + * created by another call to HttpRequest::getHistory(). + * + * Throws HttpMalformedHeaderException, HttpEncodingException. */ PHP_METHOD(HttpRequest, getHistory) { @@ -1917,7 +1928,7 @@ PHP_METHOD(HttpRequest, getHistory) SET_EH_THROW_HTTP(); if (msg = http_message_parse(PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history))) { - RETVAL_OBJVAL(http_message_object_new_ex(http_message_object_ce, msg, NULL)); + ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL)); } SET_EH_NORMAL(); }