IF_RETVAL_USED {
getObject(http_message_object, obj);
-
- if (!HTTP_MSG_TYPE(RESPONSE, obj->message)) {
- http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_RESPONSE");
- RETURN_FALSE;
- }
-
+ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE);
RETURN_LONG(obj->message->http.info.response.code);
}
}
long code;
getObject(http_message_object, obj);
- if (!HTTP_MSG_TYPE(RESPONSE, obj->message)) {
- http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_RESPONSE");
- RETURN_FALSE;
- }
+ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code)) {
RETURN_FALSE;
IF_RETVAL_USED {
getObject(http_message_object, obj);
-
- if (!HTTP_MSG_TYPE(REQUEST, obj->message)) {
- http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST");
- RETURN_FALSE;
- }
-
+ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE);
RETURN_STRING(obj->message->http.info.request.method, 1);
}
}
int method_len;
getObject(http_message_object, obj);
- if (!HTTP_MSG_TYPE(REQUEST, obj->message)) {
- http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST");
- RETURN_FALSE;
- }
+ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) {
RETURN_FALSE;
IF_RETVAL_USED {
getObject(http_message_object, obj);
-
- if (!HTTP_MSG_TYPE(REQUEST, obj->message)) {
- http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST");
- RETURN_FALSE;
- }
-
+ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE);
RETURN_STRING(obj->message->http.info.request.URI, 1);
}
}
int URIlen;
getObject(http_message_object, obj);
- if (!HTTP_MSG_TYPE(REQUEST, obj->message)) {
- http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST");
- RETURN_FALSE;
- }
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URI, &URIlen)) {
RETURN_FALSE;
}
+ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE);
if (URIlen < 1) {
http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Cannot set HttpMessage::requestUri to an empty string");
RETURN_FALSE;