[svn:mod_parrot] r330 - in mod_parrot/trunk: eg/pir lib/Apache t/lib

[email protected] Fri, 25 Jan 2008 11:26:35 -0800 (PST)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Fri Jan 25 11:26:35 2008
New Revision: 330

Modified:
   mod_parrot/trunk/eg/pir/authenhandler.pir
   mod_parrot/trunk/lib/Apache/RequestRec.pir
   mod_parrot/trunk/t/lib/handlers.pir

Log:
get_basic_auth_pw should return an array PMC, which HLLs can understand


Modified: mod_parrot/trunk/eg/pir/authenhandler.pir
==============================================================================
--- mod_parrot/trunk/eg/pir/authenhandler.pir	(original)
+++ mod_parrot/trunk/eg/pir/authenhandler.pir	Fri Jan 25 11:26:35 2008
@@ -27,7 +27,9 @@
 
     ap_const = get_root_global [ 'Apache'; 'Constants' ], 'ap_constants'
 
-    (status, pw) = r.'get_basic_auth_pw'( )
+    $P0 = r.'get_basic_auth_pw'( )
+    status = $P0[0]
+    pw = $P0[1]
 
     if pw != 'squawk' goto auth_failure
     $I0 = ap_const['OK']

Modified: mod_parrot/trunk/lib/Apache/RequestRec.pir
==============================================================================
--- mod_parrot/trunk/lib/Apache/RequestRec.pir	(original)
+++ mod_parrot/trunk/lib/Apache/RequestRec.pir	Fri Jan 25 11:26:35 2008
@@ -221,13 +221,13 @@
     ap_log_rerror( file, line, level, 0, r, msg )
 .end
 
-=item C<(INT, STRING) = get_basic_auth_pw()>
+=item C<ARRAY get_basic_auth_pw()>
 
 =over 4
 
-Returns the authentication status and password from the current request.  Also
-populates the C<user> field of Apache's C<request_rec> structure, which can be
-requested with the C<user> method.
+Returns the authentication status and password from the current request in an
+array PMC.  Also populates the C<user> field of Apache's C<request_rec>
+structure, which can be requested with the C<user> method.
 
 =back
 
@@ -246,10 +246,8 @@
     results = new 'Array'
     results = 2
     status = request_rec_get_basic_auth_pw( r, results )
-    status = results[0]
-    pw = results[1]
 
-    .return(status, pw)
+    .return(results)
 .end
 
 =item C<INT is_initial_req()>

Modified: mod_parrot/trunk/t/lib/handlers.pir
==============================================================================
--- mod_parrot/trunk/t/lib/handlers.pir	(original)
+++ mod_parrot/trunk/t/lib/handlers.pir	Fri Jan 25 11:26:35 2008
@@ -54,7 +54,10 @@
     .param pmc r
     .local pmc ap_const
 
-    ($I0, $S1) = r.'get_basic_auth_pw'( )
+    $P0 = r.'get_basic_auth_pw'( )
+    $I0 = $P0[0]
+    $S1 = $P0[1]
+
     $S0 = r.'user'( )
 
     ap_const = get_root_global [ 'Apache'; 'Constants' ], 'ap_constants'