> Thanks Geoff for taking care of this issue.
>
> I've only one prob regarding:
>
>> Index: xs/maps/apache_structures.map
>> ===================================================================
>> RCS file: /home/cvspublic/modperl-2.0/xs/maps/apache_structures.map,v
>> retrieving revision 1.18
>> diff -u -r1.18 apache_structures.map
>> --- xs/maps/apache_structures.map 12 Jan 2003 02:31:54 -0000 1.18
>> +++ xs/maps/apache_structures.map 14 Feb 2003 19:11:17 -0000
>> @@ -46,7 +46,7 @@
>> content_languages
>> > vlist_validator
>> user
>> -- ap_auth_type #should use ap_auth_type function instead
>> + ap_auth_type
>
>
> so shouldn't the ap_auth_type function be used instead of accessing the
> record directly?
>

yeah, I saw that comment, but I really didn't understand what it was doing there. the ap_auth_type() function, as defined in core.c, provides access to the AuthType config directive via r->per_dir_config. what we need is access to the ap_auth_type slot of the request record.

access to both is required for auth handlers. take a look at mod_auth_basic.c. at the top it does

/* Are we configured to be Basic auth? */
current_auth = ap_auth_type(r);

then at the end, it follows with

r->ap_auth_type = "Basic";

this pattern is followed in get_basic_auth_pw()

if (!(t = ap_auth_type(r)) || strcasecmp(t, "Basic"))
return DECLINED;

...

r->ap_auth_type = "Basic";

so, if a mod_perl module wants to implement it's own version of get_basic_auth_pw for other reasons (as Apache::AuthCookie and Apache::AuthDigest do) then they need access to both the config (for checking) and the request record (for population).

granted, having two names for the same thing is confusing, especially in Perl-land where we access both through $r, but I like the way it turned out - $r->ap_auth_type represents the actual name of the request_rec slot, while $r->auth_type represents the function, and it's common to strip the ap_ prefix from functions when we port them to mod_perl.

HTH

--Geoff



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to