stas 2004/05/27 18:36:40
Modified: . Changes t/response/TestAPR uri.pm xs/APR/URI APR__URI.h xs/maps apr_structures.map Log: APR::URI: - removed accessors o is_initialized() (internal apr_uri flag) o dns_looked_up() and dns_resolved() (they are not used by apache/apr) - all remaining accessors now accept undef value, which unsets the field Revision Changes Path 1.381 +12 -0 modperl-2.0/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.380 retrieving revision 1.381 diff -u -u -r1.380 -r1.381 --- Changes 25 May 2004 01:56:19 -0000 1.380 +++ Changes 28 May 2004 01:36:40 -0000 1.381 @@ -12,6 +12,18 @@ =item 1.99_15-dev +APR::URI: [Stas] + - removed accessors + o is_initialized() (internal apr_uri flag) + o dns_looked_up() and dns_resolved() (they are not + used by apache/apr) + - all remaining accessors now accept undef value, which unsets the + field + +Extended WrapXS code to support a new type of accessor: char * which +accepts undef to set the C pointer to NULL and as such unset the +member of the struct. [Stas] + Exception error messages now include the error id along with the error message (as they did in first place). [Stas] 1.3 +7 -6 modperl-2.0/t/response/TestAPR/uri.pm Index: uri.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/uri.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -u -r1.2 -r1.3 --- uri.pm 25 May 2004 08:42:03 -0000 1.2 +++ uri.pm 28 May 2004 01:36:40 -0000 1.3 @@ -6,7 +6,7 @@ # unparse, use strict; -use warnings;# FATAL => 'all'; +use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; @@ -38,7 +38,8 @@ fragment => ["fragment", undef ], ); -my @keys_urls = qw(scheme user password hostname port path query fragment); +my @keys_urls = qw(scheme user password hostname port path query + fragment); my @keys_hostinfo = qw(user password hostname port); sub handler { @@ -67,7 +68,8 @@ for my $method (keys %url) { no strict 'refs'; $parsed->$method($url{$method}[1]); - t_debug("$method: $url{$method}[1] => " . $parsed->$method||''); + t_debug("$method: " . ($url{$method}[1]||'undef') . + " => " . ($parsed->$method||'undef')); } ### unparse ### @@ -79,8 +81,7 @@ # updated: so we see the old value here ok t_cmp($hostinfo0, $parsed->hostinfo, "hostinfo"); - # - since the port is 21 which is the default for ftp, unparse - # omits it + # - since 21 is the default port for ftp, unparse omits it # - if no flags are passed to unparse, APR::URI_UNP_OMITPASSWORD # is passed by default -- it hides the password my $url1 = sprintf "%s://[EMAIL PROTECTED]", @@ -96,7 +97,7 @@ } ### port_of_scheme ### - while(my($scheme, $port) = each %default_ports) { + while (my($scheme, $port) = each %default_ports) { my $apr_port = APR::URI::port_of_scheme($scheme); ok t_cmp($port, $apr_port, "scheme: $scheme"); } 1.8 +12 -5 modperl-2.0/xs/APR/URI/APR__URI.h Index: APR__URI.h =================================================================== RCS file: /home/cvs/modperl-2.0/xs/APR/URI/APR__URI.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -u -r1.7 -r1.8 --- APR__URI.h 4 Mar 2004 06:01:10 -0000 1.7 +++ APR__URI.h 28 May 2004 01:36:40 -0000 1.8 @@ -54,12 +54,19 @@ 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); + if (SvOK(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); + } + else { + uri->port_str = NULL; + uri->port = 0; + } } return port_str; } + 1.16 +13 -10 modperl-2.0/xs/maps/apr_structures.map Index: apr_structures.map =================================================================== RCS file: /home/cvs/modperl-2.0/xs/maps/apr_structures.map,v retrieving revision 1.15 retrieving revision 1.16 diff -u -u -r1.15 -r1.16 --- apr_structures.map 24 May 2004 19:55:46 -0000 1.15 +++ apr_structures.map 28 May 2004 01:36:40 -0000 1.16 @@ -1,5 +1,8 @@ ########## APR structures ########## +# for mapping see %ModPerl::MapUtil::disabled_map in +# lib/ModPerl/MapUtil.pm + IGNORE: apr_pool_t apr_os_ apr_vformatter_buff_t apr_pool_t \ apr_table_t apr_in_addr_t apr_bucket_ apr_md5_ctx_t apr_sha1_ctx_t \ apr_md4_ctx_t apr_sdbm_datum_t apr_memnode_t \ @@ -169,18 +172,18 @@ </apr_text> <apr_uri_t> - scheme +& scheme hostinfo - user - password - hostname +& user +& password +& hostname - port_str - path - query - fragment +& path +& query +& fragment hostent ~ port - is_initialized - dns_looked_up - dns_resolved +- is_initialized +- dns_looked_up +- dns_resolved </apr_uri_t>