dougm       01/04/29 10:53:42

  Modified:    t/response/TestAPI uri.pm
               xs/Apache/URI Apache__URI.h
               xs/maps  apache_functions.map apache_structures.map
               xs/tables/current/ModPerl FunctionTable.pm
  Log:
  special case Apache::URI->port
  
  Revision  Changes    Path
  1.3       +14 -3     modperl-2.0/t/response/TestAPI/uri.pm
  
  Index: uri.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/uri.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- uri.pm    2001/04/28 22:42:06     1.2
  +++ uri.pm    2001/04/29 17:53:41     1.3
  @@ -12,7 +12,7 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => 12;
  +    plan $r, tests => 14;
   
       $r->args('query');
   
  @@ -50,16 +50,27 @@
   
       ok $newr->args eq 'query';
   
  -    ok $newr->parsed_uri->path eq $path;
  +    my $puri = $newr->parsed_uri;
   
  -    ok $newr->parsed_uri->query eq 'query';
  +    ok $puri->path eq $path;
   
  +    ok $puri->query eq 'query';
  +
       my @c = qw(one two three);
       $url_string = join '%20', @c;
   
       Apache::unescape_url($url_string);
   
       ok $url_string eq "@c";
  +
  +    my $port = 6767;
  +    $puri->port($port);
  +    $puri->scheme('ftp');
  +    $puri->hostname('perl.apache.org');
  +
  +    ok $puri->port == $port;
  +
  +    ok $puri->unparse eq "ftp://perl.apache.org:$port$path?query";;
   
       Apache::OK;
   }
  
  
  
  1.2       +17 -0     modperl-2.0/xs/Apache/URI/Apache__URI.h
  
  Index: Apache__URI.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/URI/Apache__URI.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Apache__URI.h     2001/04/28 22:35:22     1.1
  +++ Apache__URI.h     2001/04/29 17:53:41     1.2
  @@ -74,3 +74,20 @@
   
       return status;
   }
  +
  +static MP_INLINE
  +char *mpxs_Apache__URI_port(uri_components *uri, SV *portsv)
  +{
  +    dTHX; /*XXX*/
  +    char *port_str = uri->port_str;
  +
  +    if (portsv) {
  +        STRLEN len;
  +        char *port = SvPV(portsv, len);
  +        uri->port_str = apr_pstrndup(((modperl_uri_t *)uri)->pool,
  +                                     port, len);
  +        uri->port = (int)SvIV(portsv);
  +    }
  +
  +    return port_str;
  +}
  
  
  
  1.16      +2 -0      modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- apache_functions.map      2001/04/28 22:35:23     1.15
  +++ apache_functions.map      2001/04/29 17:53:42     1.16
  @@ -250,6 +250,8 @@
                        SV *:classname, SV *:p, uri=NULL | parse
    ap_unparse_uri_components | mpxs_ | \
                        uptr, flags=UNP_OMITPASSWORD | unparse
  + #special case to set both uri->port and uri->port_str
  + mpxs_Apache__URI_port | | uri, portsv=Nullsv
   PACKAGE=Apache::RequestRec
    mpxs_Apache__RequestRec_parsed_uri
   
  
  
  
  1.6       +2 -2      modperl-2.0/xs/maps/apache_structures.map
  
  Index: apache_structures.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- apache_structures.map     2001/04/18 16:52:49     1.5
  +++ apache_structures.map     2001/04/29 17:53:42     1.6
  @@ -223,12 +223,12 @@
      user
      password
      hostname
  -   port_str
  +-  port_str
      path
      query
      fragment
      hostent
  -   port
  +~  port
      is_initialized
      dns_looked_up
      dns_resolved
  
  
  
  1.12      +15 -1     modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FunctionTable.pm  2001/04/28 22:42:56     1.11
  +++ FunctionTable.pm  2001/04/29 17:53:42     1.12
  @@ -2,7 +2,7 @@
   
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !          Sat Apr 28 15:36:08 2001
  +# !          Sun Apr 29 10:27:28 2001
   # !          do NOT edit, any changes will be lost !
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   
  @@ -2979,6 +2979,20 @@
         }
       ],
       'name' => 'mpxs_ap_unescape_url'
  +  },
  +  {
  +    'return_type' => 'char *',
  +    'args' => [
  +      {
  +        'name' => 'uri',
  +        'type' => 'uri_components *'
  +      },
  +      {
  +        'name' => 'portsv',
  +        'type' => 'SV *'
  +      }
  +    ],
  +    'name' => 'mpxs_Apache__URI_port'
     },
     {
       'return_type' => 'SV *',
  
  
  

Reply via email to