DBI and Apache::DBI

2004-05-12 Thread I S
Hi all,

I have some questions with DBI. 

a) I don't understand why the database sometimes gets
dropped.  It happens randomly but frequently.

could not prepare: Database disconnected at
/dssweb/httpd/cgi-bin/feeds/viewReport line 157.


b) I built mod_perl and apache with EVERYTHING=1.  
Should I expect  DBI.pm appear in Apache directory?  
For some reason, it doesn't get there.  Or should I
add DBI module under Apached directory?  If so, how.  
I have my own version of Perl under home directory.

Thanks, 
Isarin  






__
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: DBI and Apache::DBI

2004-05-12 Thread Erik Scholtz, ArgonSoft GmbH
I S wrote:

Hi all,

I have some questions with DBI. 

a) I don't understand why the database sometimes gets
dropped.  It happens randomly but frequently.
could not prepare: Database disconnected at
/dssweb/httpd/cgi-bin/feeds/viewReport line 157.
b) I built mod_perl and apache with EVERYTHING=1.  
Should I expect  DBI.pm appear in Apache directory?  
For some reason, it doesn't get there.  Or should I
add DBI module under Apached directory?  If so, how.  
I have my own version of Perl under home directory.

Thanks, 
Isarin  

Hello,

DBI.pm should normaly be in the tree of your perl-installation (where 
all global modules are stored). Your httpd.conf should contain the 
following lines in the config of your domain:

LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
PerlModule Apache::DBI
Perhaps it would be easier for us to help you, if you would include the 
necessary part of your script.



Erik

-
ArgonSoft GmbH  | Im Ermlisgrund 3  | 76337 Waldbronn
Tel: +49 7243 71520 | Fax: +49 7243 715222  | http://www.argonsoft.de
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: ANNOUNCE: MasonX::WebApp 0.01

2004-05-12 Thread John Siracusa
From the docs:

 You must call clean_request_args() on the ApacheHandler object at the end of
 the request, unless you are making a new ApacheHandler object for every
 request. Otherwise bad things will happen.
 
 This is lame, so if someone thinks of a better way to do this, I'd be happy to
 hear about it.

In my massively more complicated (in both the good and bad senses of the
word), but spiritually similar Mason-using WebApp framework, I do something
like this:

---

LocationMatch ^/foo/bar
  PerlSetVar WebAppClass WebApp::Foo::Bar
  SetHandler perl-script
  PerlHandler Apache::WebApp
/LocationMatch

---

# Apache/WebApp.pm

our(%Apps, $Interp); # caches

sub handler($$)
{
  my($self, $r) = @_;

  $self = $self-new($r)  unless(ref $self);
  $self-sanity_check() or return $self-status;
  my $app = $self-app;
  $self-parse_query($r, $app)  or return $self-status;

  return $self-handle_request($r, $app);
}

...

# app is a get, set, init attribute (c.f. Class::MethodMaker)
sub init_app 
{
  my($self) = shift;

  my $r = $self-apache_request;

  my $class = $r-dir_config('WebAppClass')
or die No WebAppClass defined for this location: ,  $r-uri;

  if($r-dir_config('WebAppNoAppCache'))
  {
return $class-new();
  }
  else
  {
return $Apps{$class} ||= $class-new();
  }
}

sub init_mason_interp { $Interp ||= ... } # more get, set, init

sub handle_request
{
  my($self, $r, $app) = @_;

  $app-refresh();

  $app-params($self-params);
  $app-mason_interp($self-mason_interp);

  $app-run();

  my $status = $app-status;

  $app-clear();

  return $status;
}

---

# WebApp/Foo/Bar.pm

package WebApp::Foo::Bar;

use strict;

use WebApp;
our @ISA = qw(WebApp);

sub root_uri { '/foo/bar' } # duplicated, but oh well
...

---

Basically, I try to separate the thing that dispatches incoming requests
(Apache::WebApp) and the things that are dispatched to (the actual apps,
e.g. WebApp::Foo::Bar)

Every Location* directive has the same PerlHandler (Apache::WebApp) but
different WebAppClass  settings.

Of course, I'm free to subclass any of these classes to make some sort of
specialized behavior, but so far, the basic dumb caching dispatcher
(Apache::WebApp) has done everything I need.

But getting back to the point of this post, Apache::WebApp is where I do all
the per-request setup and cleanup, not in the apps themselves.  That way,
writing a WebApp doesn't involve worrying about any of the boring setup and
cleanup stuff that every app needs to do in order to work correctly (e.g.
Not have any stale data left over)

Session cleanup/save-back can be done either in the Apache::WebApp
dispatcher or at the end of the app objects' run() method.  In practice, I
do it in the dispatcher and also in some apps, using a save_if_modified()
method which is inexpensive enough that I don't care about duplicated calls.

You'll also notice that I do a $app-refresh before and a $app-clear
after processing a request in the dispatcher.  This is because some apps may
choose to empty themselves when not in use, even if they app object is
still cached in %apps.  So clear() would really clean out all data
structures, while refresh would rebuild them before the next run.

-John


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



ANNOUNCE: MasonX::WebApp 0.02

2004-05-12 Thread Dave Rolsky
0.02  2004-05-12

- Fix a dumb syntax error that broke the session_wrapper() method.
Reported by Michael Alan Dorman.



-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: ANNOUNCE: MasonX::WebApp 0.01

2004-05-12 Thread Dave Rolsky
On Wed, 12 May 2004, John Siracusa wrote:

  You must call clean_request_args() on the ApacheHandler object at the end of
  the request, unless you are making a new ApacheHandler object for every
  request. Otherwise bad things will happen.
 
  This is lame, so if someone thinks of a better way to do this, I'd be happy to
  hear about it.

 In my massively more complicated (in both the good and bad senses of the
 word), but spiritually similar Mason-using WebApp framework, I do something
 like this:

[ much stuff snipped ]

I think one of the reasons you can do your stuff that way is that you are
using the Mason Interp object to dispatch to Mason, rather than the
ApacheHandler object.  Mason's ApacheHandler has no mechanism for being
handed a set of arguments, it insists on getting them itself (from an
Apache::Request or CGI object), which is a little annoying.

I hope to make ApacheHandler a little less self-contained in the next
major release (1.4), but for now I'm stuck with nasty hacks.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: DBI and Apache::DBI

2004-05-12 Thread Perrin Harkins
On Wed, 2004-05-12 at 12:15, I S wrote:
 a) I don't understand why the database sometimes gets
 dropped.  It happens randomly but frequently.
 
 could not prepare: Database disconnected at
 /dssweb/httpd/cgi-bin/feeds/viewReport line 157.

Usually this is caused by an inactivity timeout on your database
server.  If you call DBI-connect before that, Apache::DBI will ping the
connection to make sure it is still live and re-connect if it isn't.

 b) I built mod_perl and apache with EVERYTHING=1.  
 Should I expect  DBI.pm appear in Apache directory?

EVERYTHING=1 affects which hooks are enabled for mod_perl handlers.  It
has nothing to do with which modules will be available.

Apache::DBI comes with mod_perl, and you should see it in your site_perl
directory.  It is a pure perl module, so it would not be under an i386
directory (or whatever your architecture is).  If you can do PerlModule
Apache::DBI in your program without failure, it means that it is there
in your @INC path.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: DBI and Apache::DBI

2004-05-12 Thread I S
 Apache::DBI comes with mod_perl, and you should see
 it in your site_perl directory.  It is a pure perl 
 module, so it would not be under an i386
 directory (or whatever your architecture is).  If
 you can do PerlModule Apache::DBI in your program 
 without failure, it means that it is there
 in your @INC path.

Sorry for being unclear.  I mean Apache subdirectory
under site_perl directory.  I can seee Registry.pm
under .../site_perl/5.8.3/sun4-solaris/Apache
directory. (Apache::Registry)  I would expect DBI in
the same directory but it is not there.   I figured
that out after it gave me an error that it can't find
Apache::DBI.

I am not sure what I missed when building mod_perl /
Apache.   Do I need to add environmental variables?


Let me recap what I did:

a) Build perl under my home directory
 /home/dssweb/local-perl 

b) Add DBI module and others 
   other modules such as LWP, HTTP are under:
  /home/dssweb/local-perl/lib/site_perl/5.8.3
   
   yet my DBI module is under:
/home/dssweb/local-perl/lib/site_perl/5.8.3/sun4-solaris


c) Build mod_perl and apache.  

My mod_perl and some Apache stuff are under 
/home/dssweb/local-perl/lib/site_perl/5.8.3/sun4-solaris


Thanks.

 





__
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: DBI and Apache::DBI

2004-05-12 Thread Brent 'Dax' Royal-Gordon
I S wrote:
Sorry for being unclear.  I mean Apache subdirectory
under site_perl directory.  I can seee Registry.pm
under .../site_perl/5.8.3/sun4-solaris/Apache
directory. (Apache::Registry)  I would expect DBI in
the same directory but it is not there.   I figured
that out after it gave me an error that it can't find
Apache::DBI.
Try .../site_perl/Apache and .../site_perl/5.8.3/Apache.  Also, if you 
originally installed mod_perl with an older version of Perl, check its 
folders.

--
Brent Dax Royal-Gordon [EMAIL PROTECTED]
Perl and Parrot hacker
Oceania has always been at war with Eastasia.

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: DBI and Apache::DBI

2004-05-12 Thread Perrin Harkins
On Wed, 2004-05-12 at 14:32, I S wrote:
 Sorry for being unclear.  I mean Apache subdirectory
 under site_perl directory.  I can seee Registry.pm
 under .../site_perl/5.8.3/sun4-solaris/Apache
 directory. (Apache::Registry)  I would expect DBI in
 the same directory but it is not there.

That's what I was saying: Apache::DBI is pure perl, so it doesn't go in
that directory.  Look in /site_perl/5.8.3/Apache instead.

 I figured
 that out after it gave me an error that it can't find
 Apache::DBI.

If you have Apache::Registry installed, you should also have Apache::DBI
installed.  Look for it with find or locate, and check the permissions
on the directories above it.

 b) Add DBI module and others 
other modules such as LWP, HTTP are under:
   /home/dssweb/local-perl/lib/site_perl/5.8.3

yet my DBI module is under:
 /home/dssweb/local-perl/lib/site_perl/5.8.3/sun4-solaris

Are you talking about DBI, not Apache::DBI?  That's an XS module so it
goes into the architecture-dependent directory.

 My mod_perl and some Apache stuff are under 
 /home/dssweb/local-perl/lib/site_perl/5.8.3/sun4-solaris

Then you should find Apache/DBI.pm under
/home/dssweb/local-perl/lib/site_perl/5.8.3.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: DBI and Apache::DBI

2004-05-12 Thread I S
Thanks, Guys,

I ended upinstalling Apache::DBI from CPAN and it isunder /home/dssweb/local-perl/lib/site_perl/5.8.3. I was mistaken that Apache::DBI would come with apache.
Event though it was, for some reason it didn't get installed.

Anyways, it is working now.

Cheers, Isarin
Perrin Harkins [EMAIL PROTECTED] wrote:
On Wed, 2004-05-12 at 14:32, I S wrote: Sorry for being unclear. I mean Apache subdirectory under site_perl directory. I can seee Registry.pm under .../site_perl/5.8.3/sun4-solaris/Apache directory. (Apache::Registry) I would expect DBI in the same directory but it is not there.That's what I was saying: Apache::DBI is pure perl, so it doesn't go inthat directory. Look in /site_perl/5.8.3/Apache instead. I figured that out after it gave me an error that it can't find Apache::DBI.If you have Apache::Registry installed, you should also have Apache::DBIinstalled. Look for it with find or locate, and check the permissionson the directories above it. b) Add DBI module and others  other modules such as LWP, HTTP are under:
 /home/dssweb/local-perl/lib/site_perl/5.8.3  yet my DBI module is under: /home/dssweb/local-perl/lib/site_perl/5.8.3/sun4-solarisAre you talking about DBI, not Apache::DBI? That's an XS module so itgoes into the architecture-dependent directory. My mod_perl and some Apache stuff are under  /home/dssweb/local-perl/lib/site_perl/5.8.3/sun4-solarisThen you should find Apache/DBI.pm under/home/dssweb/local-perl/lib/site_perl/5.8.3.- Perrin-- Report problems: http://perl.apache.org/bugs/Mail list info: http://perl.apache.org/maillist/modperl.htmlList etiquette: http://perl.apache.org/maillist/email-etiquette.html
		Do you Yahoo!?Yahoo! Movies - Buy advance tickets for 'Shrek 2' 

Re: ANNOUNCE: MasonX::WebApp 0.01

2004-05-12 Thread John Siracusa
On 5/12/04 12:30 PM, Dave Rolsky wrote:
 On Wed, 12 May 2004, John Siracusa wrote:
 You must call clean_request_args() on the ApacheHandler object at the end of
 the request, unless you are making a new ApacheHandler object for every
 request. Otherwise bad things will happen.
 
 This is lame, so if someone thinks of a better way to do this, I'd be happy
 to
 hear about it.
 
 In my massively more complicated (in both the good and bad senses of the
 word), but spiritually similar Mason-using WebApp framework, I do something
 like this:
 
 [ much stuff snipped ]
 
 I think one of the reasons you can do your stuff that way is that you are
 using the Mason Interp object to dispatch to Mason, rather than the
 ApacheHandler object.  Mason's ApacheHandler has no mechanism for being
 handed a set of arguments, it insists on getting them itself (from an
 Apache::Request or CGI object), which is a little annoying.
 
 I hope to make ApacheHandler a little less self-contained in the next
 major release (1.4), but for now I'm stuck with nasty hacks.

...which begs the question, why not use an interp in MasonX::WebApp instead
of trying to wedge in behind Mason's ApacheHandler?  After all, I think
that's the advice you originally gave me way back when... :)

-John


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Re: ANNOUNCE: MasonX::WebApp 0.01

2004-05-12 Thread Dave Rolsky
On Wed, 12 May 2004, John Siracusa wrote:

  I hope to make ApacheHandler a little less self-contained in the next
  major release (1.4), but for now I'm stuck with nasty hacks.

 ...which begs the question, why not use an interp in MasonX::WebApp instead
 of trying to wedge in behind Mason's ApacheHandler?  After all, I think
 that's the advice you originally gave me way back when... :)

Don't listen to me!

Seriously, the ApacheHandler provides some useful functionality like
parsing arguments, configuration via httpd.conf, automatic header
handling, etc.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



ANNOUNCE: MasonX::WebApp 0.04

2004-05-12 Thread Dave Rolsky
0.04  2004-05-13

- Calling clean_request_args() on the ApacheHandler object at the end
of the request is no longer needed.  Thanks to Ken Williams for
suggesting that I use $r-pnotes().  But why didn't I think of that?



-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



cvs commit: modperl-2.0/xs/Apache/Filter Apache__Filter.h

2004-05-12 Thread stas
stas2004/05/12 11:54:15

  Modified:xs/Apache/Filter Apache__Filter.h
  Log:
  tidy up
  
  Revision  ChangesPath
  1.37  +21 -21modperl-2.0/xs/Apache/Filter/Apache__Filter.h
  
  Index: Apache__Filter.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -u -r1.36 -r1.37
  --- Apache__Filter.h  10 May 2004 23:20:08 -  1.36
  +++ Apache__Filter.h  12 May 2004 18:54:15 -  1.37
  @@ -13,13 +13,13 @@
* limitations under the License.
*/
   
  -#define mp_xs_sv2_modperl_filter(sv) \
  -((SvROK(sv)  (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
  -|| (Perl_croak(aTHX_ argument is not a blessed reference),0) ? \
  -modperl_filter_mg_get(aTHX_ sv) : NULL)
  +#define mp_xs_sv2_modperl_filter(sv)\
  +((SvROK(sv)  (SvTYPE(SvRV(sv)) == SVt_PVMG))  \
  + || (Perl_croak(aTHX_ argument is not a blessed reference),0) ?   \
  + modperl_filter_mg_get(aTHX_ sv) : NULL)
   
  -#define mpxs_Apache__Filter_TIEHANDLE(stashsv, sv) \
  -modperl_newSVsv_obj(aTHX_ stashsv, sv)
  +#define mpxs_Apache__Filter_TIEHANDLE(stashsv, sv)  \
  +modperl_newSVsv_obj(aTHX_ stashsv, sv)
   
   #define mpxs_Apache__Filter_PRINT mpxs_Apache__Filter_print
   
  @@ -84,9 +84,9 @@
   }
   
   #ifdef MP_TRACE
  -#define trace_attr() \
  -MP_TRACE_f(MP_FUNC, applied %s attribute to %s handler\n, attribute, \
  -   HvNAME(stash))
  +#define trace_attr()   \
  +MP_TRACE_f(MP_FUNC, applied %s attribute to %s handler\n, attribute, \
  +   HvNAME(stash))
   #else
   #define trace_attr()
   #endif
  @@ -94,18 +94,18 @@
   /* we can't eval at this stage, since the package is not compiled yet,
* we are still parsing the source.
*/
  -#define MODPERL_FILTER_ATTACH_ATTR_CODE(cv, string, len)   \
  -{ \
  -char *str;\
  -len -= 2;/* s/ \( | \) //x   */   \
  -string++;/* skip the opening '(' */   \
  -New(0, str, len+1, char); \
  -Copy(string, str, len+1, char);   \
  -str[len] = '\0'; /* remove the closing ')' */ \
  -sv_magic(cv, Nullsv, '~', NULL, -1);  \
  -SvMAGIC(cv)-mg_ptr = str;\
  -}
  -
  +#define MODPERL_FILTER_ATTACH_ATTR_CODE(cv, string, len)\
  +{   \
  +char *str;  \
  +len -= 2;   /* s/ \( | \) //x   */  \
  +string++;   /* skip the opening '(' */  \
  +New(0, str, len+1, char);   \
  +Copy(string, str, len+1, char); \
  +str[len] = '\0';/* remove the closing ')' */\
  +sv_magic(cv, Nullsv, '~', NULL, -1);\
  +SvMAGIC(cv)-mg_ptr = str;  \
  +}
  +
   
   static XS(MPXS_modperl_filter_attributes)
   {
  
  
  


cvs commit: modperl-2.0/src/modules/perl modperl_util.h

2004-05-12 Thread stas
stas2004/05/12 18:33:52

  Modified:src/modules/perl modperl_util.h
  Log:
  explain why we always copy the string
  
  Revision  ChangesPath
  1.60  +7 -2  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -u -r1.59 -r1.60
  --- modperl_util.h13 May 2004 01:28:39 -  1.59
  +++ modperl_util.h13 May 2004 01:33:52 -  1.60
  @@ -215,8 +215,13 @@
   #endif /* USE_ITHREADS */
   
   /* dumping hundreds of lines in the trace, makes it less useful. Get a
  - * string chunk of MP_TRACE_STR_LEN or less. Not too long so it won't
  - * wrap when posted in email */
  + * string chunk of MP_TRACE_STR_LEN bytes or less. Not too long so it
  + * won't wrap when posted in email. Notice that we copy 'count' bytes
  + * of the string even if count  MP_TRACE_STR_LEN, because the 'str'
  + * buffer doesn't necessarily have \0 terminator at 'count'. As this
  + * is for debug tracing, not to be used in production, it doesn't make
  + * any difference if it's not efficient.
  + */
   #define MP_TRACE_STR_LEN 35
   #define MP_TRACE_STR_TRUNC(p, str, count)\
   count  MP_TRACE_STR_LEN \
  
  
  


cvs commit: modperl-2.0/src/modules/perl modperl_filter.c

2004-05-12 Thread stas
stas2004/05/12 18:45:30

  Modified:src/modules/perl modperl_filter.c
  Log:
  - better tracing (show the actual data as in modperl_io_apache.c)
  - extra comments
  
  Revision  ChangesPath
  1.89  +28 -17modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -u -r1.88 -r1.89
  --- modperl_filter.c  4 May 2004 06:19:11 -   1.88
  +++ modperl_filter.c  13 May 2004 01:45:30 -  1.89
  @@ -139,8 +139,8 @@
   const char *body;
   int status;
   
  -MP_TRACE_f(MP_FUNC, \n\n\tparsing headers: %d bytes [%s]\n, len,
  -   apr_pstrmemdup(wb-pool, buf, len));
  +MP_TRACE_f(MP_FUNC, \n\n\tparsing headers: %db [%s]\n, len,
  +   MP_TRACE_STR_TRUNC(wb-pool, buf, len));
   
   status = modperl_cgi_header_parse(r, (char *)buf, len, body);
   
  @@ -176,9 +176,10 @@
   APR_BRIGADE_INSERT_TAIL(bb, bucket);
   }
   
  -MP_TRACE_f(MP_FUNC, \n\n\twrite out: %d bytes\n
  +MP_TRACE_f(MP_FUNC, \n\n\twrite out: %db [%s]\n
  \t\tfrom %s\n\t\tto %s filter handler\n,
  len, 
  +   MP_TRACE_STR_TRUNC(wb-pool, buf, len),
  ((wb-r  wb-filters == wb-r-output_filters)
  ? response handler : current filter handler),
  MP_FILTER_NAME(*(wb-filters)));
  @@ -589,17 +590,19 @@
   /*modperl_brigade_dump(filter-bb_in, stderr);*/
   
   MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
  -   wanted: %d bytes\n,
  +   wanted: %db\n,
  MP_FILTER_NAME(filter-f),
  wanted);
   
   if (filter-remaining) {
   if (filter-remaining = wanted) {
   MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
  -   eating and returning %d of 
  -   remaining %d leftover bytes\n,
  +   eating and returning %d [%s]\n\tof 
  +   remaining %db\n,
  MP_FILTER_NAME(filter-f),
  -   wanted, filter-remaining);
  +   wanted,
  +   MP_TRACE_STR_TRUNC(filter-pool, filter-leftover, wanted),
  +   filter-remaining);
   sv_catpvn(buffer, filter-leftover, wanted);
   filter-leftover += wanted;
   filter-remaining -= wanted;
  @@ -607,7 +610,7 @@
   }
   else {
   MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
  -   eating remaining %d leftover bytes\n,
  +   eating remaining %db\n,
  MP_FILTER_NAME(filter-f),
  filter-remaining);
   sv_catpvn(buffer, filter-leftover, filter-remaining);
  @@ -632,7 +635,7 @@
   if (filter-rc == APR_SUCCESS) {
   MP_TRACE_f(MP_FUNC,
  MP_FILTER_NAME_FORMAT
  -   read in: %s bucket with %d bytes (0x%lx)\n,
  +   read in: %s bucket with %db (0x%lx)\n,
  MP_FILTER_NAME(filter-f),
  filter-bucket-type-name,
  buf_len,
  @@ -665,9 +668,10 @@
   
   MP_TRACE_f(MP_FUNC,
  MP_FILTER_NAME_FORMAT
  -   return: %d bytes from %d bucket%s (%d bytes leftover)\n,
  +   return: %db from %d bucket%s [%s]\n\t(%db leftover)\n,
  MP_FILTER_NAME(filter-f),
  len, num_buckets, ((num_buckets == 1) ?  : s),
  +   MP_TRACE_STR_TRUNC(filter-pool, SvPVX(buffer), len),
  filter-remaining);
   
   return len;
  @@ -785,11 +789,10 @@
   apr_bucket_alloc_t *ba = filter-f-c-bucket_alloc;
   char *copy = apr_pmemdup(filter-pool, buf, *len);
   apr_bucket *bucket = apr_bucket_transient_create(copy, *len, ba);
  -/* MP_TRACE_f(MP_FUNC, writing %d bytes: %s\n, *len, copy); */
   MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
  -   write out: %d bytes:\n,
  -   MP_FILTER_NAME(filter-f),
  -   *len);
  +   write out: %db [%s]:\n,
  +   MP_FILTER_NAME(filter-f), *len,
  +   MP_TRACE_STR_TRUNC(filter-pool, copy, *len));
   APR_BRIGADE_INSERT_TAIL(filter-bb_out, bucket);
   /* modperl_brigade_dump(filter-bb_out, stderr); */
   return APR_SUCCESS;
  @@ -882,11 +885,12 @@
   if ((av = dcfg-handlers_per_dir[idx])) {
   modperl_handler_t **handlers = (modperl_handler_t **)av-elts;
   int i;
  -ap_filter_t *f;
   
   for (i=0; iav-nelts; i++) {
   modperl_filter_ctx_t *ctx;
  +ap_filter_t *f;
   
  +/* process