Adjust previous fix to avoid compiler warnings

This commit is contained in:
Ilia Alshanetsky 2009-03-07 22:36:35 +00:00
parent 9d3030d5f3
commit 5e09a71769

View File

@ -713,22 +713,21 @@ PHP_FUNCTION(apache_request_server_port)
PHP_FUNCTION(apache_request_remote_host)
{
zval *id;
long ztype = NULL;
long type = 0;
request_rec *r;
char *res;
int type = REMOTE_NAME;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ztype) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &type) == FAILURE) {
return;
}
if (ztype) {
type = ztype;
if (!type) {
type = REMOTE_NAME
}
APREQ_GET_REQUEST(id, r);
res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, type);
res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, (int)type);
if (res) {
RETURN_STRING(res, 1);