Re: [mp1] Apache gets segfault when starting after modperl upgrade.

2003-10-03 Thread Przemyslaw Jaroszewski
On Thu, 2 Oct 2003, Thomas Nagel wrote:

>
> You may rebuild libapache-mod-perl (seems to works for my config) with
> the new perl-5.8.1 packages installed:
>

That worked. Thanks a lot!

Regards,
Przemek
-- 
"Delenda est Carthago"  /Cato the Elder/ .d~^v
Przemyslaw Jaroszewski   8E  R  T
CERT Polska, http://www.cert.pl/ `b.a'POLSKA|
[EMAIL PROTECTED]; tel.+48 22 5231377; fax.: +48 22 5231399



RE: [QUESTION] Relating a request to a response

2003-10-03 Thread Pringle, Chris (HP-PSG)
> 
> That should be pretty trivial to accomplish.
> 
> To answer your question of passing data: use notes:
> 
>$filter->r->note->set(transform => 1);
> 
> if you work with the connection level filter you will need to use:
> 
>$filter->c->note->set(transform => 1);
> 
> though remember that this note will be seen through the 
> connection, i.e. for 
> all requests coming over the same connection.
> 
> However I believe there is a much simpler solution:
> 
> add a connection level filter similar to this one: 
> http://perl.apache.org/docs/2.0/user/handlers/filters.html#Con
> nection_Input_Filters
> rewrite the request (URI) line to strip your magic argument and add a
> new 
> header, like:
> X-Chris-Transform: On
> after the request line (well may be you need to do it after the Host:
> header, 
> I'm not sure whether the server expects the Host: header second).
> 
> Now your request level filter can lookup this header:
> 
> $filter->r->headers_in->get('X-Chris-Transform');
> 
> as simple as that.

Thanks for this.

I get errors when I try and use notes. Exact error is:
Can't locate object method "note" via package "Apache::Connection"

I have got a line reading "use Apache::Connection();" at the top of my
code  :)


I prefer the second method, however I'm having some problems with it. If
I add the header in the request filter, it doesn't appear to be set when
I do 
$filter->r->headers_in->get("X-iProxy"); 

The returned result is empty.

If I telnet into the proxy and type the request manually, with the
header there, it works fine.

It's definitly adding the header in the request filter, but I can't
retrieve it through the headers_in function. It only works when the
client sends the "X-iProxy" header, not when it's added via the filter.
Any ideas?

---
Regards,
Chris Pringle

UK PSG
Hewlett-Packard, Bristol
Tel: 0117 31 29664
Mob: 07752 307063


RE: [QUESTION] Relating a request to a response

2003-10-03 Thread Pringle, Chris (HP-PSG)
Notes problem solved...I should have been using the "notes" object not
the "note" object. Found it in the mod_perl 1.0 documentation.

Will the mod_perl 2.0 documentation include all the mod_perl 1.0 API at
some point? At the moment, the API for 2.0 seems to be just changes from
1.0.

---
Regards,
Chris Pringle

UK PSG
Hewlett-Packard, Bristol
Tel: 0117 31 29664
Mob: 07752 307063


> -Original Message-
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> org] On Behalf Of Pringle, Chris (HP-PSG)
> Sent: 03 October 2003 11:50
> To: Stas Bekman
> Cc: [EMAIL PROTECTED]
> Subject: RE: [QUESTION] Relating a request to a response
> 
> 
> > 
> > That should be pretty trivial to accomplish.
> > 
> > To answer your question of passing data: use notes:
> > 
> >$filter->r->note->set(transform => 1);
> > 
> > if you work with the connection level filter you will need to use:
> > 
> >$filter->c->note->set(transform => 1);
> > 
> > though remember that this note will be seen through the
> > connection, i.e. for 
> > all requests coming over the same connection.
> > 
> > However I believe there is a much simpler solution:
> > 
> > add a connection level filter similar to this one:
> > http://perl.apache.org/docs/2.0/user/handlers/filters.html#Con
> > nection_Input_Filters
> > rewrite the request (URI) line to strip your magic argument 
> and add a
> > new 
> > header, like:
> > X-Chris-Transform: On
> > after the request line (well may be you need to do it after 
> the Host:
> > header, 
> > I'm not sure whether the server expects the Host: header second).
> > 
> > Now your request level filter can lookup this header:
> > 
> > $filter->r->headers_in->get('X-Chris-Transform');
> > 
> > as simple as that.
> 
> Thanks for this.
> 
> I get errors when I try and use notes. Exact error is:
> Can't locate object method "note" via package "Apache::Connection"
> 
> I have got a line reading "use Apache::Connection();" at the 
> top of my code  :)
> 
> 
> I prefer the second method, however I'm having some problems 
> with it. If I add the header in the request filter, it 
> doesn't appear to be set when I do 
> $filter->r->headers_in->get("X-iProxy"); 
> 
> The returned result is empty.
> 
> If I telnet into the proxy and type the request manually, 
> with the header there, it works fine.
> 
> It's definitly adding the header in the request filter, but I 
> can't retrieve it through the headers_in function. It only 
> works when the client sends the "X-iProxy" header, not when 
> it's added via the filter. Any ideas?
> 
> ---
> Regards,
> Chris Pringle
> 
> UK PSG
> Hewlett-Packard, Bristol
> Tel: 0117 31 29664
> Mob: 07752 307063
> 


Re: FAIL mod_perl-1.99_10 MSWin32-x86-multi-thread 4.0

2003-10-03 Thread Geoffrey Young

It may be that, at least for Win32, Apache/2.0.47 is needed;
http://marc.theaimsgroup.com/?l=apr-cvs&m=105631900723064&w=2
indicates apr_table_compress() was added in apr 0.9.4, which
I think means Apache/2.0.47.


Good catch, Randy. It indeed was added in 2.0.47 :(
I don't understand what is happening here on win32.  from 
modperl_apache_compat.c:

#if ! AP_MODULE_MAGIC_AT_LEAST(20020903,4)

/* added in APACHE_2_0_47/APR_0_9_4 */
void apr_table_compress(apr_table_t *t, unsigned flags)
{
modperl_apr_func_not_implemented(apr_table_compress, 2.0.47, 0.9.4);
}
#endif /* pre-APR_0_9_5 (APACHE_2_0_47) */

so it should be defined for 2.0.46, just not available for use.  and 2.0.46 
compiles just fine for me on linux.

is win32 somehow not picking up the compat file, or is there some additional 
logic that we need for this kind of thing?  I pretty much copied what was 
there before when we had other APR back-compat issues.

--Geoff



Re: FAIL mod_perl-1.99_10 MSWin32-x86-multi-thread 4.0

2003-10-03 Thread Randy Kobes
On Fri, 3 Oct 2003, Geoffrey Young wrote:

> >> It may be that, at least for Win32, Apache/2.0.47 is needed;
> >> http://marc.theaimsgroup.com/?l=apr-cvs&m=105631900723064&w=2
> >> indicates apr_table_compress() was added in apr 0.9.4, which
> >> I think means Apache/2.0.47.
> >
> >
> > Good catch, Randy. It indeed was added in 2.0.47 :(
>
> I don't understand what is happening here on win32.  from
> modperl_apache_compat.c:
>
> #if ! AP_MODULE_MAGIC_AT_LEAST(20020903,4)
>
>
> /* added in APACHE_2_0_47/APR_0_9_4 */
> void apr_table_compress(apr_table_t *t, unsigned flags)
> {
>  modperl_apr_func_not_implemented(apr_table_compress, 2.0.47, 0.9.4);
> }
>
>
> #endif /* pre-APR_0_9_5 (APACHE_2_0_47) */
>
> so it should be defined for 2.0.46, just not available for
> use.  and 2.0.46 compiles just fine for me on linux.
>
> is win32 somehow not picking up the compat file, or is
> there some additional logic that we need for this kind of
> thing?  I pretty much copied what was there before when we
> had other APR back-compat issues.

I think it is a Win32 thing ... The missing
apr_table_compress symbol comes when trying to build
APR/Table.dll, and for pre Apache/2.0.47 this would be found
in mod_perl.so (aka mod_perl.dll on Win32). When building
APR/Table.dll the associated mod_perl.lib is included in the
libraries to be linked against, but mod_perl.lib doesn't
contain the full symbol definitions, which are in
mod_perl.so. I've had similar problems before trying to
build a dll which needs a symbol that's found in another
dll; I think some fiddling with the definition of the symbol
in the 2nd dll may be needed. I could try doing that, which
might be also useful later on down the road ...

-- 
best regards,
randy


Re: FAIL mod_perl-1.99_10 MSWin32-x86-multi-thread 4.0

2003-10-03 Thread Geoffrey Young

I think it is a Win32 thing ... The missing
apr_table_compress symbol comes when trying to build
APR/Table.dll, and for pre Apache/2.0.47 this would be found
in mod_perl.so (aka mod_perl.dll on Win32). When building
APR/Table.dll the associated mod_perl.lib is included in the
libraries to be linked against, but mod_perl.lib doesn't
contain the full symbol definitions, which are in
mod_perl.so. 
this is sounding vaguely familiar, like those emails you always used to send 
about adding some missing symols somplace after a feature was added in 1.0...

I've had similar problems before trying to
build a dll which needs a symbol that's found in another
dll; I think some fiddling with the definition of the symbol
in the 2nd dll may be needed. I could try doing that, which
might be also useful later on down the road ...
indeed, especially since we can expect the compat file to grow again as time 
progresses.

sorry for the hassle, though - if it weren't for apr_table_compress we 
wouldn't have any back compat issues to deal with (presently, at least).

--Geoff



Re: [QUESTION] Relating a request to a response

2003-10-03 Thread Stas Bekman
Pringle, Chris (HP-PSG) wrote:
Notes problem solved...I should have been using the "notes" object not
the "note" object. Found it in the mod_perl 1.0 documentation.
Yes, sorry about that.

Will the mod_perl 2.0 documentation include all the mod_perl 1.0 API at
some point? At the moment, the API for 2.0 seems to be just changes from
1.0.
Yes, at some point. We need help with getting the 2.0 docs done.

__
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


[MP2] problem with command line args to perl Makefile.PL (includes patch)

2003-10-03 Thread Andrew Wyllie

(I originally tried sending this to the dev list but it did not seem
to go through for some reason...)


I was running into a problem trying to build MP2 with a name other
than mod_perl.so.  After poking around for a while I found that the
MP_LIBNAME arg on the command line was not replacing the default
value of mod_perl.so, but just appending it.  So if I specify something
like:

perl Makefile.pl MP_LIBNAME=mod_perl-2.0_cvs

I get back something like:

mod_perl dso library will be built as mod_perl mod_perl_1.99.10.so
mod_perl static library will be built as mod_perl mod_perl_1.99.10.a

Anyway, I patched lib/ModPerl/BuildOptions.pm so that you can tell the script
whether you want to append the command line arg or replace it.  The patch is
included here, but someone should check to make sure that the options I have
selected as appendable/replaceable are in fact such.


thanks
Andrew




Index: lib/ModPerl/BuildOptions.pm
===
RCS file: /home/cvspublic/modperl-2.0/lib/ModPerl/BuildOptions.pm,v
retrieving revision 1.21
diff -u -r1.21 BuildOptions.pm
--- lib/ModPerl/BuildOptions.pm 13 Aug 2003 22:54:10 -  1.21
+++ lib/ModPerl/BuildOptions.pm 2 Oct 2003 18:49:18 -
@@ -83,10 +83,15 @@
 }
 }
 
-if ($self->{$key}) {
-$self->{$key} .= ' ';
+if ( $table->{$key}->{'append'} ){
+   if ($self->{$key}) {
+$self->{$key} .= ' ';
+   }
+$self->{$key} .= $val;
+
+} else {
+$self->{$key} = $val;
 }
-$self->{$key} .= $val;
 
 print "   $key = $val\n" if $opts & VERBOSE;
 }
@@ -137,7 +142,7 @@
 
 sub usage {
 my $table = table();
-my @opts = map { "$_ - $table->{$_}" } sort keys %$table;
+my @opts = map { "$_ - $table->{$_}->{'val'}" } sort keys %$table;
 join "\n", @opts;
 }
 
@@ -151,8 +156,8 @@
 s/^\s+//; s/\s+$//;
 next if /^\#/ || /^$/;
 last if /^__END__/;
-my($key, $val) = split /\s+/, $_, 2;
-$table{'MP_' . $key} = $val;
+my($key, $append, $val) = split /\s+/, $_, 3;
+$table{'MP_' . $key} = { append => $append, val => $val};
 }
 
 return \%table;
@@ -166,24 +171,32 @@
 
 1;
 
+# data format:
+# key  append  description
+# where:
+# key:is the option name
+# append: is whether we want to replace a default option (0)
+# or append the arg to the option (1)
+# desc:   descripttion for this option
+
 __DATA__
 
-USE_GTOP   Link with libgtop and enable libgtop reporting
-DEBUG  Turning on debugging (-g -lperld) and tracing
-MAINTAINER Maintainer mode: DEBUG=1 -DAP_DEBUG -Wall ...
-CCOPTS Add to compiler flags
-TRACE  Turn on tracing
-USE_DSOBuild mod_perl as a dso
-USE_STATIC Build mod_perl static
-INST_APACHE2   Install *.pm relative to Apache2/ directory
-PROMPT_DEFAULT Accept default value for all would-be prompts
-OPTIONS_FILE   Read options from given file
-STATIC_EXTSBuild Apache::*.xs as static extensions
-APXSPath to apxs
-AP_PREFIX  Apache installation or source tree prefix
-APR_CONFIG Path to apr-config
-XS_GLUE_DIR Directories containing extension glue
-INCLUDE_DIR Add directories to search for header files
-GENERATE_XS Generate XS code based on httpd version
-LIBNAME Name of the modperl dso library (default is mod_perl)
-COMPAT_1X   Compile-time mod_perl 1.0 backcompat (default is on)
+USE_GTOP   0   Link with libgtop and enable libgtop reporting
+DEBUG  0   Turning on debugging (-g -lperld) and tracing
+MAINTAINER 0   Maintainer mode: DEBUG=1 -DAP_DEBUG -Wall ...
+CCOPTS 1   Add to compiler flags
+TRACE  0   Turn on tracing
+USE_DSO0   Build mod_perl as a dso
+USE_STATIC 0   Build mod_perl static
+INST_APACHE2   0   Install *.pm relative to Apache2/ directory
+PROMPT_DEFAULT 0   Accept default value for all would-be prompts
+OPTIONS_FILE   0   Read options from given file
+STATIC_EXTS0   Build Apache::*.xs as static extensions
+APXS0  Path to apxs
+AP_PREFIX  0   Apache installation or source tree prefix
+APR_CONFIG 0   Path to apr-config
+XS_GLUE_DIR 1  Directories containing extension glue
+INCLUDE_DIR 1  Add directories to search for header files
+GENERATE_XS 0  Generate XS code based on httpd version
+LIBNAME 0  Name of the modperl dso library (default is mod_perl)
+COMPAT_1X   0  Compile-time mod_perl 1.0 backcompat (default is on)

- End forwarded message -

- End forwarded message -


Re: [QUESTION] Relating a request to a response

2003-10-03 Thread Stas Bekman
Pringle, Chris (HP-PSG) wrote:
That should be pretty trivial to accomplish.

To answer your question of passing data: use notes:

  $filter->r->note->set(transform => 1);

if you work with the connection level filter you will need to use:

  $filter->c->note->set(transform => 1);

though remember that this note will be seen through the 
connection, i.e. for 
all requests coming over the same connection.

However I believe there is a much simpler solution:

add a connection level filter similar to this one: 
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Con
nection_Input_Filters
rewrite the request (URI) line to strip your magic argument and add a
new 
header, like:
X-Chris-Transform: On
after the request line (well may be you need to do it after the Host:
header, 
I'm not sure whether the server expects the Host: header second).

Now your request level filter can lookup this header:

$filter->r->headers_in->get('X-Chris-Transform');

as simple as that.


Thanks for this.

I get errors when I try and use notes. Exact error is:
Can't locate object method "note" via package "Apache::Connection"
I have got a line reading "use Apache::Connection();" at the top of my
code  :)
I prefer the second method, however I'm having some problems with it. If
I add the header in the request filter, it doesn't appear to be set when
I do 
$filter->r->headers_in->get("X-iProxy"); 

The returned result is empty.

If I telnet into the proxy and type the request manually, with the
header there, it works fine.
It's definitly adding the header in the request filter, but I can't
retrieve it through the headers_in function. It only works when the
client sends the "X-iProxy" header, not when it's added via the filter.
Any ideas?
Actually it was a much more complicated task than I suggested. This is due to 
the assumptions taken by the headers_in core http filter which populates 
$r->headers_in. It wan't each header to reside in its own bucket. Moreover, it 
has to be in its own bucket brigade. So forget the streaming filter API and 
welcome bucket brigades. The implementation is still pretty trivial, but 
requires some tricky queueing and unqueueing of the headers, because each 
filter invocation needs to send exactly one header.

I suppose the headers_in core http filter does that in order to get a better 
performance. so it always grabs just the first bucket and ignores the rest. I 
should really look at its source code.

The following is a much more generic example than you need, so you will be 
able to simplify it a great deal. I'll commit that soon as a new test. I see 
some problem which I need to debug more, but it won't affect your task.

If you fail to comprehend my notes below and convert that example into what 
you want, I'll help you to get your particular task done, which should be 
pretty easy once you understand how the thing work ;)

In fact I'll commit that test, so you can see it in action, including the 
client side. Update your modperl-2.0 cvs, run

t/TEST -conf

to update the config

and now run:

/TEST -v -trace=debug filter/in_bbs_inject_header

and you will see a trace of everything that's happening inside the filter in 
error_log.

When I'll resolve the problem I see, I'll commit a fix. But the test passes 
regardless that problem.

Here is the code. It's pretty small if you remove all the comments.

package TestFilter::in_bbs_inject_header;

# this filter demonstrates two things:
# 1. how to write a filter that will work only on HTTP headers
# 2. how to inject extra HTTP headers
#
# the first task is simple -- as soon as a bucket which matches
# /^[\r\n]+$/ is read we can store that event in the filter context and
# simply 'return Apache::DECLINED on the future invocation, so not to
# slow things.
#
#
# the second task is a bit trickier, as the headers_in core httpd
# filter is picky and it wants each header to arrive in a separate
# bucket, and moreover this bucket needs to be in its own brigade.
# so this test arranges for this to happen.
#
# the test shows how to push headers at the end of all headers
# and in the middle, whichever way you prefer.
use strict;
use warnings;# FATAL => 'all';
use base qw(Apache::Filter);

use Apache::RequestRec ();
use Apache::RequestIO ();
use APR::Brigade ();
use APR::Bucket ();
use Apache::Test;
use Apache::TestUtil;
use Apache::TestTrace;
use Apache::Const -compile => qw(OK DECLINED);
use APR::Const-compile => ':common';
my $header1_key = 'X-My-Protocol';
my $header1_val = 'POST-IT';
my %headers = (
'X-Extra-Header2' => 'Value 2',
'X-Extra-Header3' => 'Value 3',
);
# returns 1 if a bucket with a header was inserted to the $bb's tail,
# otherwise returns 0 (i.e. if there are no buckets to insert)
sub inject_header_bucket {
my ($bb, $ctx) = @_;
return 0 unless @{ $ctx->{buckets} };

my $bucket = shift @{ $ctx->{buckets} };
$bb->insert_tail($bucket);
if (1) {
# extra debug, wasting cycles
my $data;
$buc

ANNOUNCE: Bricolage 1.6.6

2003-10-03 Thread David Wheeler
I'm pleased to announce announce the release of Bricolage 1.6.6.
This maintenance release addresses a number issues discovered since
the release of version 1.6.5. Some of the more important changes
include:
*   Added README.Solaris.

*   When an asset is published or deployed directly from the asset
profile, it is now properly removed from the publish or deploy 
desk.

*   Templates now display their output channel associations instead 
of
their element associations on desks. This seems to be more 
useful,
since the element association is usually obvious from the name.

*   The category URI is now displayed for assets on desks, rather 
than
the name. This is consistent with the display of the category
elsewhere.

*   Elements to which no subelements can be added will no longer 
display
an empty select list and "Add Element" button.

*   Bug fix when deploying to multiple output channels. If the 
output
channel IDs matched each other partly, it could cause a file to 
be
removed after it just had been uploaded.

*   Users with CREATE access to a start desk can once again create
stories on that desk even when they don't have CREATE access to 
"All
Stories."

*   Each upgrade script is now run within the confines of a single
database transaction. If any database changes within an upgrade
script encounter an error, all of the changes in that script 
will be
rolled back.

*   An upgrade script failure will now cause "make upgrade" to halt
installation so that any issues are immediately identified and
correctable.
For a complete list of the changes, see the changes file at:

  http://sourceforge.net/project/shownotes.php?release_id=188766

ABOUT BRICOLAGE

Bricolage is a full-featured, enterprise-class content management and
publishing system. It offers a browser-based interface for ease-of use,
a full-fledged templating system with complete HTML::Mason and
HTML::Template support for flexibility, and many other features. It
operates in an Apache/mod_perl environment, and uses the PostgreSQL
RDBMS for its repository. A comprehensive, actively-developed open
source CMS, Bricolage has been hailed as "Most Impressive" in 2002 by
eWeek.
Learn more about Bricolage and download it from the Bricolage home page,
http://bricolage.cc/.
Enjoy!

David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED]  ICQ: 15726394
http://www.kineticode.com/ Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]
Kineticode. Setting knowledge in motion.[sm]


[mp1] 1.29 release candidate #1

2003-10-03 Thread Philippe M. Chiasson
The mod_perl 1.29 release candidate #1 has arrived. It can be
downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.28_01-dev-rc1.tar.gz

MD5 : 9f3e81dcdea7cdda3715631c25e446ef
SHA1: 1d14efb2ad89750dabcb3780b92992c1b8744551

The summary of what has changed since 1.28 are (from Changes):

Add a workaround for the 'rand' bug for perl 5.8.1 (compiled with
either -DUSE_HASH_SEED or -DUSE_HASH_SEED_EXPLICIT, which is the
default), causing all forked procs to produce the same rand
sequence. [Stas]

For Win32, add an INSTALL_LIB option to 'perl Makefile.PL' to
allow one to specify where to install mod_perl.lib. If not
given, this defaults to APACHE_SRC\libexec, if this exists.
Suggested by Steve Hay [randyk]

Fix t/net/perl/sym.pl (called by modules/symbol) not to affect other
tests (internal/http-get and internal/http-post, which were failing to
call exit) [Stas]

Fix Apache::ExtUtils to work with blead perl (it was breaking the
build) http://rt.perl.org/rt2/Ticket/Display.html?id=23803 [Stas]

On Win32 the uploaded file wasn't cleaned up (weither it's a bug in
CGI.pm or not), make sure we don't leave any dropped files around
[Steve Hay <[EMAIL PROTECTED]>]

For Win32, keep drive letters in mod_perl.dsp to fix bug, reported 
by DH <[EMAIL PROTECTED]>, when compiling mod_perl in
cases where Apache and Perl are on different drives [Randy Kobes]. 

Add workaround to define statcache in Apache.xs so that
one can build on Win32 ActivePerl 8xx with LARGE_FILES
support [Randy Kobes]

--

A more detailled review of each patch included in this release candidate 
can be found here:

http://www.apache.org/~gozer/mp1/1.28-dev/



Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'


signature.asc
Description: This is a digitally signed message part