You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2013/07/11 00:57:07 UTC
svn commit: r1502045 -
/perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c
Author: stevehay
Date: Wed Jul 10 22:57:06 2013
New Revision: 1502045
URL: http://svn.apache.org/r1502045
Log:
Move all declarations before code: VC++ doesn't support code before declarations unless compiling as C++.
Modified:
perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c
Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c?rev=1502045&r1=1502044&r2=1502045&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c Wed Jul 10 22:57:06 2013
@@ -938,20 +938,21 @@ static authz_status perl_check_authoriza
authz_status ret = AUTHZ_DENIED;
int count;
AV *args = Nullav;
+ char *key;
+ auth_callback *ab;
+ MP_dTHX;
+ dSP;
if (global_authz_providers == NULL) {
return ret;
}
- const char *key = apr_table_get(r->notes, AUTHZ_PROVIDER_NAME_NOTE);
- auth_callback *ab = apr_hash_get(global_authz_providers, key,
- APR_HASH_KEY_STRING);
+ key = apr_table_get(r->notes, AUTHZ_PROVIDER_NAME_NOTE);
+ ab = apr_hash_get(global_authz_providers, key, APR_HASH_KEY_STRING);
if (ab == NULL) {
return ret;
}
- MP_dTHX;
-
if (ab->cb1 == NULL) {
if (ab->cb1_handler == NULL) {
return ret;
@@ -965,7 +966,6 @@ static authz_status perl_check_authoriza
return ret;
}
- dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
@@ -992,23 +992,23 @@ static const char *perl_parse_require_li
SV *ret_sv;
char *ret = NULL;
int count;
+ void *key;
+ auth_callback *ab;
+ modperl_interp_t *interp = modperl_interp_pool_select(cmd->server->process->pool,
+ cmd->server);
+ dTHXa(interp->perl);
+ dSP;
if (global_authz_providers == NULL) {
return ret;
}
- void *key;
apr_pool_userdata_get(&key, AUTHZ_PROVIDER_NAME_NOTE, cmd->temp_pool);
- auth_callback *ab = apr_hash_get(global_authz_providers, (char *) key,
- APR_HASH_KEY_STRING);
+ ab = apr_hash_get(global_authz_providers, (char *) key, APR_HASH_KEY_STRING);
if (ab == NULL || ab->cb2 == NULL) {
return ret;
}
- modperl_interp_t *interp = modperl_interp_pool_select(cmd->server->process->pool,
- cmd->server);
- dTHXa(interp->perl);
- dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
@@ -1040,20 +1040,22 @@ static authn_status perl_check_password(
authn_status ret = AUTH_DENIED;
int count;
AV *args = Nullav;
+ char *key;
+ auth_callback *ab;
+ MP_dTHX;
+ dSP;
if (global_authn_providers == NULL) {
return ret;
}
- const char *key = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
- auth_callback *ab = apr_hash_get(global_authn_providers, key,
+ key = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
+ ab = apr_hash_get(global_authn_providers, key,
APR_HASH_KEY_STRING);
if (ab == NULL || ab->cb1) {
return ret;
}
- MP_dTHX;
-
if (ab->cb1 == NULL) {
if (ab->cb1_handler == NULL) {
return ret;
@@ -1068,7 +1070,6 @@ static authn_status perl_check_password(
return ret;
}
- dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
@@ -1095,21 +1096,22 @@ static authn_status perl_get_realm_hash(
authn_status ret = AUTH_USER_NOT_FOUND;
int count;
SV *rh;
+ char *key;
+ auth_callback *ab;
+ MP_dTHX;
+ dSP;
if (global_authn_providers == NULL) {
return ret;
}
- const char *key = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
- auth_callback *ab = apr_hash_get(global_authn_providers, key,
- APR_HASH_KEY_STRING);
+ key = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
+ ab = apr_hash_get(global_authn_providers, key, APR_HASH_KEY_STRING);
if (ab == NULL || ab->cb2) {
return ret;
}
- MP_dTHX;
rh = sv_2mortal(newSVpv("", 0));
- dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
@@ -1122,8 +1124,9 @@ static authn_status perl_get_realm_hash(
SPAGAIN;
if (count == 1) {
+ char *tmp;
ret = (authn_status) POPi;
- char *tmp = SvPV_nolen(rh);
+ *tmp = SvPV_nolen(rh);
if (*tmp != '\0') {
*rethash = apr_pstrdup(r->pool, tmp);
}