Re: cvs commit: modperl-2.0 Changes

2002-08-15 Thread Stas Bekman

Doug MacEachern wrote:
> On Mon, 12 Aug 2002, Stas Bekman wrote:
> 
> 
>>it failed to create the wrapper because the API included an 'int *'
>>arg, whose typemap was undefined. Is it safe to use 'int * | PTR' 
>>typemap? I've checked the conversion functions and they seem to do the 
>>right thing:
> 
> 
> that's fine for the typemap.

added

>>that's said should the XS generator generate a fatal error when an XS 
>>wrapper is not created, because one of the argument's typemap is unknown?
> 
> 
> maybe.  i found it better the way it is now for early development, using 
> the util/xs_check.pl to tell me whats not getting mapped in a summary.

are we still in the early development?

>>in any case, the automatic wrapper now gets added. But its arguments are:
>>
>>const char *
>>ap_get_remote_host(conn, dir_config, type, str_is_ip)
>> Apache::Connection conn
>> void * dir_config
>> int type
>> int * str_is_ip
>>
>>should the wrapper accept $r instead of $c (requiring a manual wrapper)?
> 
> 
> no.  should be able to use $c->get_remote_host(...) in a protocol handler 
> that does not have an $r.  but the Apache::compat method can take care of 
> that.
> 
> 
>>should we NULL the str_is_ip argument?
> 
> 
> default to NULL, i think.  i don't actually know what it is used for.
> looks like dir_config should also default to NULL.
> and type to REMOTE_NAME (like 1.x).
> with $dir_config and $str_is_ip being optional args after type.

I doubt mod_perl programmers will find any use for $str_is_ip. So I've 
added a wrapper ala mod_perl 1.0, plus an optional dir_config arg:

  mpxs_Apache__Connection_get_remote_host | | c, type=REMOTE_NAME, 
dir_config=Nullsv

and the 1.0 wrapper in compat. Hope it's OK.



__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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




Re: ModPerl::Registry root

2002-08-15 Thread Stas Bekman

Doug MacEachern wrote:
> On Wed, 29 May 2002, Stas Bekman wrote:
> 
> 
>>>if a subclass wants to keep the cache in its own package, it can do:
>>
>>but then it ends up not under 1 "root"
> 
> 
> right.  difference is, the subclass defined that behavior.  currently it 
> is not possible for a subclass to define where the cache lives.
>  
> 
>>Also to avoid confusion, I'd rather stay in ModPerl:: namespace, so my 
>>best choice is ModPerl::RegistryCache.
> 
> 
> that's fine.  so long as one can subclass to change the default to 
> whatever they choose.

It's done now. The core Registry packages all compile the scripts into 
ModPerl::RegistryROOT:: namespace and cache them in 
%ModPerl::RegistryCache. Both overridable by the sub-classes.


__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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




Re: ModPerl::Registry root

2002-08-15 Thread Stas Bekman


> It's done now. The core Registry packages all compile the scripts into 
> ModPerl::RegistryROOT:: namespace and cache them in 
> %ModPerl::RegistryCache. Both overridable by the sub-classes.

What I don't like about this change is that it's now impossible to use 
two different registry modules to cache the same script. (of course 
unless these modules override the default cache symbol table)
e.g. I try to use RegistryLoader on the same script with different 
registry modules and of course the second load will be skipped given 
that the two compile to the same package name.


__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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




RE: can't fine ModuleConfig.c.

2002-08-15 Thread Goehring, Chuck Mr., RCI - San Diego


Thanks.  You are the hero of us lonely Windows Apache users.

Chuck


-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 11:10 PM
To: Goehring, Chuck Mr., RCI - San Diego
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: can't fine ModuleConfig.c.


On Mon, 12 Aug 2002, Goehring, Chuck Mr., RCI - San Diego wrote:

> Randy,
> 
> I'm using Perl 5.6.0 for this. Should I be using 5.8.0?  Does
> that affect ModuleConfig.c?
> 
> Having problems running things with the version I put out last
> week.  It complains about the dumbest things and is overly
> strict.
> 
> Thanks
> Chuck

I'm not sure if this will help, but an error you had in an
earlier message for 'perl Makefile.PL' indicated you didn't have
touch() on your system (which is typical for Win32). You might
want to try the attached patch to Makefile.PL, which uses a perl
command for touch().

-- 
best regards,
randy

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




compilation errors

2002-08-15 Thread Dave Smith

trying to compile mod_perl-2.0 gives the following errors:
(apache-2.0.40 already built/installed):


$ make
cd "src/modules/perl" && make -f Makefile.modperl
make[1]: Entering directory `/usr/local/src/modperl-2.0_cvs/src/modules/perl'
cc -I/usr/local/src/modperl-2.0_cvs/src/modules/perl 
-I/usr/local/src/modperl-2.0_cvs/xs -I/usr/local/src/httpd-2.0_cvs/include 
-I/usr/local/src/httpd-2.0_cvs/srclib/apr/include 
-I/usr/local/src/httpd-2.0_cvs/srclib/apr-util/include 
-I/usr/local/src/httpd-2.0_cvs/os/unix -D_REENTRANT -fno-strict-aliasing 
-I/usr/local/include   -I/usr/local/lib/perl5/5.6.1/i686-linux-thread/CORE -DMOD_PERL 
-O2 -fpic \
-c mod_perl.c && mv mod_perl.o mod_perl.lo
mod_perl.c: In function `modperl_shutdown':
mod_perl.c:10: `thr' undeclared (first use in this function)
mod_perl.c:10: (Each undeclared identifier is reported only once
mod_perl.c:10: for each function it appears in.)
mod_perl.c: In function `modperl_hook_post_config':
mod_perl.c:414: `thr' undeclared (first use in this function)
mod_perl.c: In function `modperl_response_handler_cgi':
mod_perl.c:675: `thr' undeclared (first use in this function)
make[1]: *** [mod_perl.lo] Error 1
make[1]: Leaving directory `/usr/local/src/modperl-2.0_cvs/src/modules/perl'
make: *** [modperl_lib] Error 2
root@sindhu [make] /usr/local/src/modperl-2.0  
   02-08-15  6:39PM



$ t/REPORT

-8<-- Start Bug Report 8<--
1. Problem Description:

  [DESCRIBE THE PROBLEM HERE]

2. Used Components and their Configuration:

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX=> /usr/local/src/httpd-2.0_cvs
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME  => mod_perl
  MP_USE_DSO  => 1
  MP_USE_STATIC   => 1


*** /usr/sbin/httpd -V
Server version: Apache/1.3.23 (Unix)  (Red-Hat/Linux)
Server built:   Jun 19 2002 11:55:23
Server's Module Magic Number: 19990320:13
Server compiled with
 -D EAPI
 -D EAPI_MM
 -D EAPI_MM_CORE_PATH="/var/run/httpd.mm"
 -D HAVE_MMAP
 -D HAVE_SHMGET
 -D USE_SHMGET_SCOREBOARD
 -D USE_MMAP_FILES
 -D HAVE_FCNTL_SERIALIZED_ACCEPT
 -D HAVE_SYSVSEM_SERIALIZED_ACCEPT
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="/var/run/httpd.scoreboard"
 -D DEFAULT_LOCKFILE="/var/run/httpd.lock"
 -D DEFAULT_XFERLOG="/var/log/httpd/access_log"
 -D DEFAULT_ERRORLOG="/var/log/httpd/error_log"
 -D TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
 -D ACCESS_CONFIG_FILE="conf/access.conf"
 -D RESOURCE_CONFIG_FILE="conf/srm.conf"


*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=linux, osvers=2.4.3-12, archname=i686-linux-thread
uname='linux sindhu 2.4.3-12 #1 fri jun 8 15:05:56 edt 2001 i686 unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=define useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.1 2.96-85)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
libc=/lib/libc-2.2.2.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_THREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Oct  6 2001 13:39:45
  %ENV:
PERL_LWP_USE_HTTP_10="1"
  @INC:
/usr/local/lib/perl5/5.6.1/i686-linux-thread
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux-thread
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
.


3. This is the core dump trace: (if you get a core dump):

  [CORE TRACE COMES HERE]

This report was generated by t/REPORT on Thu Aug 15 22:50:21 2002 GMT.

-8<-- End Bug Report -

[PATCH] adjusting for API renaming

2002-08-15 Thread Stas Bekman

This patch adjusts the renames made in Apache 2.0 on:

date: 2002/07/06 20:04:38;  author: ianh;  state: Exp;  lines: +2 -2
Renames Pending:
  This clears the list of renames pending in apr-util.
  Parts of this list was alreadu done, but the pending list hadn't been 
updated.

  apr_hook_debug_current from apr_current_hooking_module
  apr_hook_debug_showfrom apr_show_hook

  apr_hook_global_pool   from apr_global_hook_pool
  apr_hook_sort_all  from apr_sort_hooks

  apr_uri_port_of_scheme from apr_uri_default_port_for_scheme
  apr_uri_unparsefrom apr_uri_unparse_components
  apr_uri_parse  from apr_uri_parse_components
  apr_uri_parse_hostinfo from apr_uri_parse_hostinfo_components

  apr_uri_t  from apr_uri_components

  All APR_URI_*  from all APU_URI_* symbols
  All APR_UNP_*  from all UNP_* symbols


Index: lib/Apache/ParseSource.pm
===
RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
retrieving revision 1.40
diff -u -r1.40 ParseSource.pm
--- lib/Apache/ParseSource.pm   15 Aug 2002 02:44:08 -  1.40
+++ lib/Apache/ParseSource.pm   16 Aug 2002 03:16:12 -
@@ -366,7 +366,7 @@
  my %seen;
  my $wanted = $self->wanted_structures;
  my $other  = join '|', qw(_rec module
-  piped_log uri_components htaccess_result
+  piped_log uri_t htaccess_result
cmd_parms cmd_func cmd_how);

  my @structures;
Index: t/response/TestAPI/rutil.pm
===
RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/rutil.pm,v
retrieving revision 1.3
diff -u -r1.3 rutil.pm
--- t/response/TestAPI/rutil.pm 11 Apr 2002 11:08:43 -  1.3
+++ t/response/TestAPI/rutil.pm 16 Aug 2002 03:16:12 -
@@ -43,7 +43,7 @@
  ok $r->get_limit_req_body || 1;

  while(my($scheme, $port) = each %default_ports) {
-my $apr_port = APR::URI::default_port_for_scheme($scheme);
+my $apr_port = APR::URI::port_of_scheme($scheme);
  #$r->puts("$scheme => expect: $port, got: $apr_port\n");
  ok $apr_port == $port;
  }
Index: xs/maps/apr_functions.map
===
RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v
retrieving revision 1.45
diff -u -r1.45 apr_functions.map
--- xs/maps/apr_functions.map   23 Jun 2002 22:00:03 -  1.45
+++ xs/maps/apr_functions.map   16 Aug 2002 03:16:12 -
@@ -476,8 +476,8 @@
   apr_hook_deregister_all
   apr_hook_sort_register
  -apr_register_optional_fn
- apr_show_hook
- apr_sort_hooks
+ apr_hook_debug_show
+ apr_hook_sort_all
   apr_optional_hook_add
   apr_optional_hook_get

@@ -564,7 +564,7 @@
uptr, flags=APR_URI_UNP_OMITPASSWORD | unparse
   #special case to set both uri->port and uri->port_str
   mpxs_APR__URI_port | | uri, portsv=Nullsv
- apr_uri_default_port_for_scheme
+ apr_uri_port_of_scheme

  !MODULE=Apache::XML
   apr_text_append
Index: xs/tables/current/Apache/FunctionTable.pm
===
RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v
retrieving revision 1.38
diff -u -r1.38 FunctionTable.pm
--- xs/tables/current/Apache/FunctionTable.pm   25 May 2002 18:36:36 -  1.38
+++ xs/tables/current/Apache/FunctionTable.pm   16 Aug 2002 03:16:13 -
@@ -12540,7 +12540,7 @@
},
{
  'return_type' => 'apr_port_t',
-'name' => 'apr_uri_default_port_for_scheme',
+'name' => 'apr_uri_port_of_scheme',
  'args' => [
{
  'type' => 'const char *',


__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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




Re: compilation errors

2002-08-15 Thread Stas Bekman

[it'd be nice if you set your From: field:

From: Dave Smith <>
To: [EMAIL PROTECTED]

]

Dave Smith wrote:
> trying to compile mod_perl-2.0 gives the following errors:
> (apache-2.0.40 already built/installed):

For some reason it finds Apache/1.3.23

> *** /usr/sbin/httpd -V
> Server version: Apache/1.3.23 (Unix)  (Red-Hat/Linux)
   ^

so we cannot see the build args. how did you build httpd-2.0?
/whereever/httpd-2.0/is/installed/httpd -V

 >usethreads=define use5005threads=define useithreads=undef 
usemultiplicity=undef

You need to build perl with -Duseithreads or without threads at all (if 
you aren't building a threaded mpm). Yours is built with 
-Duse5005threads, which won't work with mod_perl 2.0, since this perl 
threading model is deprecated. In any case for using the threaded mpms 
you need perl 5.8.0.


__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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




the build system finds the wrong apxs when built against the source

2002-08-15 Thread Stas Bekman

As you saw in the bug report from Dave Smith, t/REPORT has found the 
wrong httpd for the report, when he was building against the source. 
I've traced it to this snippet of code in TestConfig.pm:

sub default_apxs {
 my $self = shift;

 return $self->{vars}->{apxs} if $self->{vars}->{apxs};

 if (my $build_config = modperl_build_config()) {
 return $build_config->{MP_APXS};
 }

 $ENV{APXS} || which('apxs');
}

it seems that Dave's build has called which('apxs'), which has found 
/usr/sbin/apxs which brought him /usr/sbin/httpd, which is wrong.

Any reason for having the which() call there? Why guessing, where there 
is a risk to guess wrong? I suggest to nuke it:

Index: Apache-Test/lib/Apache/TestConfig.pm
===
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.141
diff -u -r1.141 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm14 Aug 2002 02:31:11 
- 1.141
+++ Apache-Test/lib/Apache/TestConfig.pm16 Aug 2002 04:46:02 -
@@ -470,7 +470,7 @@
  return $build_config->{MP_APXS};
  }

-$ENV{APXS} || which('apxs');
+$ENV{APXS};
  }

  sub default_httpd {

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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




Re: ModPerl::Registry root

2002-08-15 Thread Stas Bekman

Stas Bekman wrote:
> 
>> It's done now. The core Registry packages all compile the scripts into 
>> ModPerl::RegistryROOT:: namespace and cache them in 
>> %ModPerl::RegistryCache. Both overridable by the sub-classes.
> 
> 
> What I don't like about this change is that it's now impossible to use 
> two different registry modules to cache the same script. (of course 
> unless these modules override the default cache symbol table)
> e.g. I try to use RegistryLoader on the same script with different 
> registry modules and of course the second load will be skipped given 
> that the two compile to the same package name.

As I was afraid a single namespace for all compiled packaged proved to 
be a bad idea when using more than one registry handler on the same 
filename, since all sort of collissions started to happen. Therefore 
I've resorted to the following solution:

- all packages are compiled into:

join '::', 'ModPerl::ROOT', ref($self), $path_to_string

so now the same script /home/httpd/cgi-bin/env.pl gets compiled into:

ModPerl::ROOT::ModPerl::RegistryBB::home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl::Registry::home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl::RegistryFoo::home_httpd_cgi_2dbin_env_2epl

Should we kill the extra :: to make things a bit faster? As in

ModPerl::ROOT::ModPerl__RegistryBB_home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl__Registry_home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl__RegistryFoo_home_httpd_cgi_2dbin_env_2epl

I suppose that keeping the distinction between the registry handler and 
the script's path, will allow us to group the scripts by their registry 
handler in Apache::Status, so may be we should keep :: after all.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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