On 09/28/2012 05:50 PM, Andy Colson wrote:
I'm attempting to fix a "make test" that is failing:

$ t/TEST -verbose api/access
... lots of output ...

# testing : auth_type
# expected: none
# received: undef
not ok 8
# testing : auth_type
# expected: Basic
# received: Basic
ok 9
ok 10


After searching around a little (there are lots of generated files), I
think I've come across the source:

xs/Apache2/Access/Apache2__Access.h

static MP_INLINE
const char *mpxs_Apache2__RequestRec_auth_type(pTHX_ request_rec *r,
                                               char *type)
{
     if (type) {
         mpxs_insert_auth_cfg(aTHX_ r, "AuthType", type);
     }

     return ap_auth_type(r);
}

ap_auth_type():  Older doc say "If no authentication menthod is
applicable, this routine returns NULL".  I cannot seem to find the
function at http://apr.apache.org/docs/apr/1.4/index.html

Not sure if it's still actual, but this is not apr function, you can find its definition as it's in 2.2 branch in http_core.h [1].

In 2.4, it returns NULL only when mod_authn_core is not loaded I think [2].

[1] http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/include/http_core.h?revision=1166612&view=markup

[2] http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/core.c?revision=1373168&view=markup

I'm not sure how this used to work... but would I want to do something
like:


static MP_INLINE
const char *mpxs_Apache2__RequestRec_auth_type(pTHX_ request_rec *r,
                                               char *type)
{
     if (type) {
         mpxs_insert_auth_cfg(aTHX_ r, "AuthType", type);
     }

     const char *tmp = ap_auth_type(r);
     if (! tmp){
         return "none";
     }
     else {
         return tmp;
     }
}


am I in the right ballpark here?

I think this looks OK, but I don't have big experience with mod_perl :). I'm not sure if you should not return Perl equivalent of NULL in this case to do the same thing as ap_auth_type.

-Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org


Regards,
Jan Kaluza


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org

Reply via email to