Re: FW: ezmlm response

2002-09-12 Thread Per Einar Ellefsen

At 04:19 13.09.2002, Ask Bjoern Hansen wrote:
>On Thu, 12 Sep 2002 [EMAIL PROTECTED] wrote:
>
> > Hi,
> >
> > is there a way to subscribe to mod_perl digest only?
> > The page http://perl.apache.org/maillist/modperl.html
> > lists strangely the same address as for normal subscr.
>
>That's a typo then; it should be
>[EMAIL PROTECTED] to subscribe to the digest.

Thanks for the catch, corrected now.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: NTLM module and POST

2002-09-12 Thread Mark Holland

Hi Gerald, 

I have been having exactly the same problems. My set up is:
IE 5.5, SP2 (I also have tried with IE6 -same problem)
NT 4.0 SP6
Webserver: Apache 1.3.26 running on solaris 8. 

At first I was using Apache::AuthenNTLM 0.14 and I couldn't get any POSTs to 
go through, after I upgraded to 0.21 about 1 in 5 POSTs fail. 

I did read somewhere that IE doesn't handle POST in certain circumstances 
under http/1.1, however trying to force a downgrade to 1.0 causes the 
request to hang when AuthenNTLM tries to send back the NTLM header. 

Unfornately this machine is trapped behind a firewall so I cant set up an 
environment for you to repoduce the error, however If you need any further 
info I'd be happy to help. 

Thanks for your help (and a promising module ;) ),
Mark 

 

 --
Mark Holland
[EMAIL PROTECTED]
http://www.thinkfoo.com/



Re: FW: ezmlm response

2002-09-12 Thread Ask Bjoern Hansen

On Thu, 12 Sep 2002 [EMAIL PROTECTED] wrote:

> Hi,
>
> is there a way to subscribe to mod_perl digest only?
> The page http://perl.apache.org/maillist/modperl.html
> lists strangely the same address as for normal subscr.

That's a typo then; it should be
[EMAIL PROTECTED] to subscribe to the digest.


 - ask

-- 
ask bjoern hansen, http://askbjoernhansen.com/  !try;
develooper llc,http://www.develooper.com/   do();




RE: ezmlm response

2002-09-12 Thread Alexander.Farber

Sorry!! I actually wanted to send this mail 
to [EMAIL PROTECTED] not modperl@

> is there a way to subscribe to mod_perl digest only?
> The page http://perl.apache.org/maillist/modperl.html
> lists strangely the same address as for normal subscr.



FW: ezmlm response

2002-09-12 Thread Alexander.Farber

Hi,

is there a way to subscribe to mod_perl digest only?
The page http://perl.apache.org/maillist/modperl.html
lists strangely the same address as for normal subscr.

Thanks
Alex


> -Original Message-
> From: ext [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 12:53 PM
> To: Farber Alexander (NMP/Bochum)
> Subject: ezmlm response
> 
> 
> Hi! This is the ezmlm program. I'm managing the
> [EMAIL PROTECTED] mailing list.
> 
> I'm working for my owner, who can be reached
> at [EMAIL PROTECTED]
> 
> This is a generic help message. The message I received wasn't sent to
> any of my command addresses.
> 
> 
> --- Administrative commands for the modperl list ---
> 
> I can handle administrative requests automatically. Please
> do not send them to the list address! Instead, send
> your message to the correct command address:
> 
> To subscribe to the list, send a message to:
><[EMAIL PROTECTED]>
> 
> To remove your address from the list, send a message to:
><[EMAIL PROTECTED]>
> 
> Send mail to the following for info and FAQ for this list:
><[EMAIL PROTECTED]>
><[EMAIL PROTECTED]>
> 
> To get message 12 from the archive, send a message to:
><[EMAIL PROTECTED]>
> 
> The messages do not really need to be empty, but I will ignore
> their content. Only the ADDRESS you send to is important.
> 
> You can start a subscription for an alternate address,
> for example "[EMAIL PROTECTED]", just add a hyphen and your
> address (with '=' instead of '@') after the command word:
> <[EMAIL PROTECTED]>
> 
> To stop subscription for this address, mail:
> <[EMAIL PROTECTED]>
> 
> In both cases, I'll send a confirmation message to that address. When
> you receive it, simply reply to it to complete your subscription.
> 
> If despite following these instructions, you do not get the
> desired results, please contact my owner at
> [EMAIL PROTECTED] Please be patient, my owner is a
> lot slower than I am ;-)
> 
> --- Enclosed is a copy of the request I received.
> 
> Return-Path: <[EMAIL PROTECTED]>
> Received: (qmail 88586 invoked from network); 12 Sep 2002 
> 10:52:47 -
> Received: from mgw-x1.nokia.com (131.228.20.21)
>   by daedalus.apache.org with SMTP; 12 Sep 2002 10:52:47 -
> Received: from esvir01nok.ntc.nokia.com 
> (esvir01nokt.ntc.nokia.com [172.21.143.33])
>   by mgw-x1.nokia.com (Switch-2.2.1/Switch-2.2.0) with 
> ESMTP id g8CAqjk12464
>   for <[EMAIL PROTECTED]>; Thu, 12 Sep 2002 
> 13:52:45 +0300 (EET DST)
> Received: from esebh003.NOE.Nokia.com (unverified) by 
> esvir01nok.ntc.nokia.com
>  (Content Technologies SMTPRS 4.2.5) with ESMTP id 
> <[EMAIL PROTECTED]> for 
> <[EMAIL PROTECTED]>;
>  Thu, 12 Sep 2002 13:51:58 +0300
> Received: from duebh001.NOE.Nokia.com ([172.25.112.170]) by 
> esebh003.NOE.Nokia.com with Microsoft SMTPSVC(5.0.2195.5329);
>Thu, 12 Sep 2002 13:51:58 +0300
> Received: from boebe003.NOE.Nokia.com ([172.25.50.187]) by 
> duebh001.NOE.Nokia.com with Microsoft SMTPSVC(5.0.2195.5329);
>Thu, 12 Sep 2002 12:51:57 +0200
> content-class: urn:content-classes:message
> MIME-Version: 1.0
> Content-Type: text/plain;
>   charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> Subject: 
> X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0
> Date: Thu, 12 Sep 2002 12:51:57 +0200
> Message-ID: 
> <[EMAIL PROTECTED]>
> X-MS-Has-Attach: 
> X-MS-TNEF-Correlator: 
> Thread-Index: AcJaSmpRagO7FrblS4OLmDYq0PtWCg==
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> X-OriginalArrivalTime: 12 Sep 2002 10:51:58.0098 (UTC) 
> FILETIME=[6A850F20:01C25A4A]
> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> 
> 
> 
> --
> Local SW Tools Coordinator, Tel. +49-234-984-4849
> 



Re: newbie: file uploads not working :(

2002-09-12 Thread Steve Piner



Geoffrey Young wrote:
> 
> > Note: If you ever use them in file posts, don't forget to clean the file
> > names, especially when it comes from Windows machine...
> >
> 
> I've found this to be reasonably portable for getting just the
> filename (sans path) - YMMV
> 
> my ($name) = $upload->filename =~ m!([^/\\]*$)!;

Erm.. portable maybe, (MacOS?) but what about secure? That lets through
shell meta-characters, which may or may not be a problem. (What if the
filename is '|mail%20cracker@somewhere'?)

I'm inclined to be a little more restrictive:

my ($name) = $upload->filename =~ m!([^\w\.]*$)!;

(And even then, that's not secure under windows - NUL, LPT1, etc.)

Steve

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz



Re: newbie: file uploads not working :(

2002-09-12 Thread simran

In your HTML, do you have as part of the  an enctype defined... 

eg. 

  


If you do not have the enctype then your script will not be able to get
the file handle... 

simran.

On Fri, 2002-09-13 at 05:32, Alan wrote:
> On Thu, Sep 12, 2002 at 03:24:50PM -0400, Geoffrey Young wrote:
> > 
> > 
> > [snip]
> > >
> > ># This is a copy of the form code from the snippets page
> > >sub form {
> > >   use Apache::Request;
> > >   my $r = Apache->request();
> > >   my $apr = Apache::Request->new($r, DISABLE_UPLOADS => 1);
> > 
> > I think DISABLE_UPLOADS should be 0, not 1.  I can't find any other 
> > obvious errors in what you have...
> 
> Yea, caught this just after I sent the email :)
> 
> > and see if it helps clarify things.  in particular, you might want to 
> > add a call to $apr->parse to see what it returns - that may help you 
> > debug things some more.
> 
> It returns 0.  I threw the example code from the apache::request parse()
> section into sub form and nada.  I'm wondering if it has somthing to do
> with my HTML or something?  Is my html-fu doing something stupid?
> 
> Thanks
> 
> alan
> 
> -- 
> Alan "Arcterex" <[EMAIL PROTECTED]>   -=][=-   http://arcterex.net
> "I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I
> think I preferred the cows. They were better conversation, easier to milk, and
> if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson
> 
> 
> 






Re: Documentation for Apache::exit()?

2002-09-12 Thread Ged Haywood

Hi there,

On Wed, 11 Sep 2002, Francisco Corella wrote:

> The Modules book by Lincoln Stein and Doug MacEachern (pp.464-465)
> says that Apache::exit() can be used to halt script execution
> without terminating the process and without logging an error.

Ask yourself why you want to call an exit() function.  Do you really
want to terminate the process?  If you were to call exit() within the
Apache/mod_perl process, things would fall over rather badly from the
perspective of the user of a browser, and maybe elsewhere too.

Perhaps you really want to stop handling the request, so all you need
to do is to tell Apache that you're done.  To do that, usually you'd
return a value like OK or DECLINED to Apache.  Then it can do all the
cleaning up that has to be done.

> The User Guide at http://perl.apache.org/docs/1.0/guide/index.html

Huge, isn't it?  :)

> However, the Apache documentation itself does not mention an exit()
> function. Neither "perldoc Apache" nor the documentation at
> http://perl.apache.org/docs/1.0/api/Apache.html contain the word
> "exit".  Am I looking in the wrong place?

Maybe you're asking the wrong question.  If you must, have a look in
Apache.xs - (but don't say I didn't warn you...:)

73,
Ged.




Re: newbie: file uploads not working :(

2002-09-12 Thread darren chamberlain

* Geoffrey Young <[EMAIL PROTECTED]> [2002-09-12 15:45]:
> > Note: If you ever use them in file posts, don't forget to clean the
> > file names, especially when it comes from Windows machine...
> 
> I've found this to be reasonably portable for getting just the 
> filename (sans path) - YMMV
> 
> my ($name) = $upload->filename =~ m!([^/\\]*$)!;

  use File::Basename;
  my $name = basename($upload->filename);

(darren)

-- 
There is no expedient to which a man will not go to
avoid the real labour of thinking.



Error messages in Apache::Registry

2002-09-12 Thread William McKee

Hi folks,

I'm a new user to mod_perl. I'm using Apache::Registry to run some scripts 
that have been written using the CGI::Application framework. Previously, 
under mod_cgi, I've been using the CGI::Carp set_message method of 
capturing a die and returning a customized error message to the screen.

Under Apache::Registry, it seems that my set_message routine is not being 
used. Instead I'm getting the following output:

...my error message here... at 
/usr/local/lib/perl5/site_perl/5.6.1/MyLib.pm line 479.

200 OK

OK
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator,
 [EMAIL PROTECTED] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.
More information about this error may be available
in the server error log.

Apache/1.3.26 Server at www.knowmad.com Port 80

- end --

Is there a way to tell A::Registry not to do this? From the docs, I see 
that there is a  $Apache::Registry::Debug setting. However the description 
doesn't mean much to me. And it doesn't mention what the default debug 
level is.

Any help much appreciated,
William

-- 
 Lead Developer
 Knowmad Services Inc. || Internet Applications & Database Integration
 http://www.knowmad.com
 




Re: newbie: file uploads not working :(

2002-09-12 Thread Geoffrey Young


> Note: If you ever use them in file posts, don't forget to clean the file
> names, especially when it comes from Windows machine...
> 

I've found this to be reasonably portable for getting just the 
filename (sans path) - YMMV

my ($name) = $upload->filename =~ m!([^/\\]*$)!;

--Geoff




Re: newbie: file uploads not working :(

2002-09-12 Thread Paul de Repentigny

Alan,

Much easier to read would be:

sub handler {
my $r = Apache::Request->new(shift);
my $file_name = $r->param('see_below');
my $file = $r->upload('see_below');
if ($file) {
# here you go...
# filehandle is in $file->fh;
}
}

On the HTML side,  should read:


Note: If you ever use them in file posts, don't forget to clean the file
names, especially when it comes from Windows machine...

Paul.

Alan écrivit:

> Hi folks.  I'm new to the list, and relatively new to mod_perl, but a
> big project thrown my way put me right in the middle, and I think I've
> fared well so far, with one exception... file uploads.  I've based my
> code off the apache::request documentation and the file upload code
> snippet posted here and on the perl.apache.org site.
> 
> I have the following configured:
> 
> ...snip... 
> -





Re: newbie: file uploads not working :(

2002-09-12 Thread Alan

On Thu, Sep 12, 2002 at 03:24:50PM -0400, Geoffrey Young wrote:
> 
> 
> [snip]
> >
> ># This is a copy of the form code from the snippets page
> >sub form {
> >   use Apache::Request;
> >   my $r = Apache->request();
> >   my $apr = Apache::Request->new($r, DISABLE_UPLOADS => 1);
> 
> I think DISABLE_UPLOADS should be 0, not 1.  I can't find any other 
> obvious errors in what you have...

Yea, caught this just after I sent the email :)

> and see if it helps clarify things.  in particular, you might want to 
> add a call to $apr->parse to see what it returns - that may help you 
> debug things some more.

It returns 0.  I threw the example code from the apache::request parse()
section into sub form and nada.  I'm wondering if it has somthing to do
with my HTML or something?  Is my html-fu doing something stupid?

Thanks

alan

-- 
Alan "Arcterex" <[EMAIL PROTECTED]>   -=][=-   http://arcterex.net
"I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I
think I preferred the cows. They were better conversation, easier to milk, and
if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson



Re: newbie: file uploads not working :(

2002-09-12 Thread Geoffrey Young



[snip]
> 
> # This is a copy of the form code from the snippets page
> sub form {
>use Apache::Request;
>my $r = Apache->request();
>my $apr = Apache::Request->new($r, DISABLE_UPLOADS => 1);

I think DISABLE_UPLOADS should be 0, not 1.  I can't find any other 
obvious errors in what you have...

if that doesn't work out, you may want to try this code

http://www.modperlcookbook.org/code/ch03/Cookbook/PrintUploads.pm

and see if it helps clarify things.  in particular, you might want to 
add a call to $apr->parse to see what it returns - that may help you 
debug things some more.

you may want to take a look and the tempname() and link() methods for 
your uploaded object once you get things figured out :)


HTH

--Geoff




Re: newbie: file uploads not working :(

2002-09-12 Thread Alan

(replying to self in true newbie style)

On Thu, Sep 12, 2002 at 12:08:11PM -0700, Alan wrote:
> # This is a copy of the form code from the snippets page
> sub form {
>use Apache::Request;
>my $r = Apache->request();
>my $apr = Apache::Request->new($r, DISABLE_UPLOADS => 1);

The DISABLE_UPLOADS wasn't actually there, that was a holdover from
testing to try to get *any* response from an upload that I forgot about
when I pasted the code in.  Even if it was in there, it should have
errored out if an upload was attempted right?

alan the sheepish



-- 
Alan "Arcterex" <[EMAIL PROTECTED]>   -=][=-   http://arcterex.net
"I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I
think I preferred the cows. They were better conversation, easier to milk, and
if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson



[ANNOUNCE] Apache::ASP v2.39 released

2002-09-12 Thread Josh Chamas

Hey,

Apache::ASP v2.39 is released to CPAN.  This is a minor
bug fix release & below are the changes.  For more on
Apache::ASP, please see http://www.apache-asp.org

Regards,

Josh

Josh Chamas, Founder   phone:925-552-0128
Chamas Enterprises Inc.http://www.chamas.com
NodeWorks Link Checkinghttp://www.nodeworks.com


$MODULE=Apache::ASP; $VERSION = 2.39; $DATE="09/10/2002"

- Turn off $^W explicitly before reloading global.asa.  Reloading
   global.asa when $^W is set will trigger subroutine redefinition
   warnings.  Reloading global.asa should occur without any problems
   under normal usage of the system, thus this work around.

   This fix is important to UseStrict functionality because warnings
   automatically become thrown as die() errors with UseStrict enabled,
   so we have to disable normal soft warnings here.

- $Response->Include() runtime errors now throw a die() that
   can be trapped.  This was old functionality that has been restored.
   Other compile time errors should still trigger a hard error
   like script compilation, global.asa, or $Response->Include()
   without an eval()

+ Some better error handling with Debug 3 or -3 set, cleaned
   up developer errors messages somewhat.




newbie: file uploads not working :(

2002-09-12 Thread Alan

Hi folks.  I'm new to the list, and relatively new to mod_perl, but a
big project thrown my way put me right in the middle, and I think I've
fared well so far, with one exception... file uploads.  I've based my
code off the apache::request documentation and the file upload code
snippet posted here and on the perl.apache.org site.

I have the following configured:



SetHandler perl-script
PerlHandler Test::Upload
PerlInitHandler Apache::StatINC


My Test/Upload.pm looks something like this:

-
package Test::Upload;
use strict;
use Apache::Constants qw(:common);
use Apache::Log;
use Apache::File();
use Apache::Request;

sub handler {
   my $r = shift;

   my $form = form();

   if (my $file = $form->{UPLOAD})
   {
  my $filelocation="/home/alan/code/test/htdocs/files";
  my $filename = $file->filename; # If you need the name
  open F, ">$filelocation";
  my $filehandle = $file->fh;
  while (my $d = <$filehandle>) 
  {
 print F $d;
  }
  close F;
   }

   $r->content_type('text/html');
   $r->send_http_header;
   print <

Upload a file:  

END

   return OK;
}

1;

# This is a copy of the form code from the snippets page
sub form {
   use Apache::Request;
   my $r = Apache->request();
   my $apr = Apache::Request->new($r, DISABLE_UPLOADS => 1);
   my @keys = $apr->param;

   my %form;
   foreach my $key(@keys) {

  my @value = $apr->param($key);
  next unless scalar @value;

  if ( @value > 1 ) {
 $form{$key} = \@value;
  } else {
 $form{$key} = $value[0];
  }
   }

   my $upload = $apr->upload;
   if ($upload) {
  $form{UPLOAD} = $upload;
   }

   return \%form;
}

-

As far as I can tell, the code should see the upload, grab the upload
via $apr->upload, and use it.  However, nothing happens. 

Even if I put in copious debug (for example, code that prints out when
if($upload){ } is hit), nothing.  It's as if the upload is not taking
place at all.

Can anyone give me a hand with this, I'm literally beating my head
against the table!

TIA

Alan

-- 
Alan "Arcterex" <[EMAIL PROTECTED]>   -=][=-   http://arcterex.net
"I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I
think I preferred the cows. They were better conversation, easier to milk, and
if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson



Re: performance regarding mod_perl vs mod_c with embedded perl

2002-09-12 Thread mod_perl

Hi Josh,

How about the "dual setup", a plain Apache + a mod_perl 
Apache, which some mod_perl sites are based on? Another 
interesting candidate is fastCGI. 


Peter
> We get very similar numbers in our benchmarking.  Please see
> the benchmarks I have published on this at:
> 
>http://chamas.com/bench/
> 
> If you compare the results of the Hellow World 2000
> vs. the Hello World for mod_perl and C Apache API module,
> you will see that the performance gap narrows the more
> application type work you do.  This would not hold up
> if you were doing intensive number crunching I might add,
> where C would be much better in the end game, but if you
> are just doing web applications, you probably won't get
> much more performance out of a pure C implementation.
> 
> Note, that if you ever have any critical sections of code
> in perl that need to be optimized, you can always code
> up that section in C using XS or the newer Inline:: modules.
> Further realize that if you pick an application environment
> like Template Toolkit, Embperl, or AxKit, you are often
> getting a lot of fast C under the hood anyway as those
> authors have already done the optimizations for you.
> 
> Regards,
> 
> Josh
> 
> Josh Chamas, Founder   phone:925-552-0128
> Chamas Enterprises Inc.http://www.chamas.com
> NodeWorks Link Checkinghttp://www.nodeworks.com
> 



Re: performance regarding mod_perl vs mod_c with embedded perl

2002-09-12 Thread Perrin Harkins

Pierre Laplante wrote:
> I do not use mod_perl with CGI emulation.

Actually PerlSetupEnv is on by default.  Put PerlSetupEnv Off in your 
httpd.conf.

> Here is my mod_perl code:

You are not running the same Perl code in both situations.  Under 
mod_perl, you are using Apache::File and various methods of the perl 
version of the request record ($r).  In your mod_c version, you do those 
things in C.  That will make a difference.  You seem to be using 
Error.pm to trap errors in the mod_perl version and normal eval/die 
constructs (called from C) in the mod_c version.  Error.pm will slow 
things down a little.  Also, if you are not handling any phases of the 
request other than the content handler, you can improve the speed of 
mod_perl by compiling it without the hooks for the other phases.

- Perrin