RE: Intercepting with data for mod_dav

2005-02-04 Thread Jeff Finn
I've been doing this with mod_perl 2.. here's the relative parts of my
config:

  Alias /dav_files /home/users

  #
  # hook into the other phases for
  #
  Location /dav_files
PerlOutputFilterHandler MyEncrypt::output
PerlInputFilterHandler  MyEncrypt::input

PerlSetOutputFilter DEFLATE

#
# Request Phase Handlers
#
PerlAuthenHandlerMyAuthenticate

AuthType basic
AuthName xxx
Require valid-user
Satisfy all
  /Location

  #
  # Actual access to the files use will be already authenticated
  #
  Directory /home/users/*/
AllowOverride   None
DAV on
  /Directory
==

Hope this helps.

To the list:
My encryption is proprietary based on the PW the user sends... anyone know a
tested symmetric streaming (not block) encryption algoritm?

Jeff

-Original Message-
From: Stefan Sonnenberg-Carstens [mailto:[EMAIL PROTECTED]
Sent: Friday, February 04, 2005 9:11 AM
To: modperl@perl.apache.org
Subject: Intercepting with data for mod_dav


Hi list,
I'm struggeling a bit with the following :
I set a mod_dav DAV server, which works fine.
One thing I *must* accomplish, is to write the
uploaded files encrypted in some way to the disk,
and publish them back unencrypted.
That should be perfectly possible with
apache's filters.
The problem seems to be, that mod_perl doesn't see
anything if dav is set to on on a specific dir ?
Is that true ?
What I need is small (very small) hint, how to get the data
that the PUT and GET requests offer, or if this
is possible at all.

Thx in advance,

Stefan Sonnenberg



RE: ModPerl::Registry: Software caused connection abort

2004-08-09 Thread Jeff Finn
Except Stas is not getting the error when he tries it... hmm.

I'm going to check it again tonight, and I'll include the error
log output.  I'm also going to try to use the eval statement he
suggested in the test, but I'm not sure that it will be practical
for me in my application.

BTW, Stas:
certain versions of curl require -k to disable verification of the
certificate... on cygwin it does, but on redhat 9.0 it doesn't.  Sorry,
I forgot to mention that in my reply

Jeff

-Original Message-
From: Dan Wilga [mailto:[EMAIL PROTECTED]
Sent: Monday, August 09, 2004 11:53 AM
To: [EMAIL PROTECTED]
Subject: RE: ModPerl::Registry: Software caused connection abort


From: Jeff Finn [EMAIL PROTECTED]
Ok; I have generated a semi-self-contained Apache-test that will produce
this error.

I'm glad, because I wasn't having any luck producing a simple test 
case that would work from IE, much less something more reproducible!

Hopefully now the mod_perl wizards can get to the bottom of the problem.

-- 
Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075Who left the cake out in the rain?

-- 
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


-- 
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: ModPerl::Registry: Software caused connection abort

2004-08-05 Thread Jeff Finn
Ok; I have generated a semi-self-contained Apache-test that will produce
this error.

This only happens on an SSL-enabled server

I was't able to get the alarm block working, but we can work around that
by starting the test, sleeping for a minute or so, and then in another
shell getting the url and ctrl-c'ing before the transfer completes.

in one shell
# make test TEST_VERBOSE=1

once the server starts, in another shell:
#  curl -o /tmp/curl.out https://127.0.0.1:8530/handler

here's the apache test file

Jeff

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 04, 2004 11:45 PM
To: Jeff Finn
Cc: [EMAIL PROTECTED]
Subject: Re: ModPerl::Registry: Software caused connection abort


Jeff Finn wrote:
 I'm joining this thread a little late, but I just noticed I have a similar
 problem to this with Apache 2.0.49/50 and mp1.99_14.

 I have the server set up for responses to pass thru a filter:

 PerlOutputFilterHandler Apache::FileProtector::output

 When I use curl to access the server and hit ctrl-c during the data xfer,
 I get a message in the error log:

 [Wed Aug 04 22:17:34 2004] [error] [client 192.168.123.32] Software caused
 connection abort at /usr/webstoreit/perl/Apache/FileProtector.pm line
61.\n
 Software caused connection abort.

 I didn't notice this behavior with previous versions of Apache 2.

 i'm not sure how to go about working around this problem, does
 anyone have some suggestions?

Yes, they should be internal to mod_perl. Give us a self contained
Apache-Test test that we can reproduce the problem with and we will find
some good solution for it. Please use:
http://apache.org/~geoff/Apache-Test-skeleton-mp2.tar.gz
As suggested before you should be able to emulate Ctrl-C with alarm
block. Please make it as simple as possible. Thanks.

--
__
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

--
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


SoftwareCausedConnectionAbortMP2.tar.gz
Description: GNU Zip compressed data
-- 
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: ModPerl::Registry: Software caused connection abort

2004-08-04 Thread Jeff Finn
I'm joining this thread a little late, but I just noticed I have a similar
problem to this with Apache 2.0.49/50 and mp1.99_14.

I have the server set up for responses to pass thru a filter:

PerlOutputFilterHandler Apache::FileProtector::output

When I use curl to access the server and hit ctrl-c during the data xfer,
I get a message in the error log:

[Wed Aug 04 22:17:34 2004] [error] [client 192.168.123.32] Software caused
connection abort at /usr/webstoreit/perl/Apache/FileProtector.pm line 61.\n
Software caused connection abort.

I didn't notice this behavior with previous versions of Apache 2.

i'm not sure how to go about working around this problem, does
anyone have some suggestions?

Thanks

Jeff

-Original Message-
From: Nick Phillips [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 04, 2004 5:21 PM
To: [EMAIL PROTECTED]
Subject: Re: ModPerl::Registry: Software caused connection abort


On 03/08/2004, at 7:40 AM, Dan Wilga wrote:

 At 12:02 PM -0700 8/2/04, Stas Bekman wrote:
 Upon sending the response. The original error message happens in my
 code when I try to print the HTTP header.

 Yeah, that's what I thought. I suppose we could handle that
 internally then. But I want to have a failing test first. It should
 work with LWP, just as you see in LWP. Not sure how to arrange that
 with LWP. Ideas? We need to start the request and then kill it. I
 suppose we could do an alarm handler, but with 5.8.0 safe signals
 things, I'm not sure it will actually work. Can you give it a try?

 I'm using LWP::UserAgent::timeout (which essentially uses alarm), and
 am not having any luck reproducing the problem yet. The timeout does
 happen, but apparently LWP drops the connection in a different way
 from IE, because the error doesn't occur. I'm even using SSL to test
 this.

I seem to recall a known IE bug with the way it drops connections when
using
SSL. Maybe google for ssl-unclean-shutdown together with MSIE? I
think it
also suffers when keepalive is used, in that sometimes it will send
incorrect
content-length headers with POST requests.

Cheers,


Nick
--
Nick Phillips / +64 3 479 4195 / [EMAIL PROTECTED]
# these statements are my own, not those of the University of Otago


--
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


-- 
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



[mp2] Trouble with Apache::Filter input and mod_dav

2004-03-15 Thread Jeff Finn
Hi,

I'm trying to write an input filter that will read the request body data, do
some transformation, and then write the output to a file using mod_dav:

Location /davtest/
DAV on
PerlInputFilterHandler  FileDataLog::input
/Location

The problem I'm having is that whenever I try to PUT a file that contains
null characters (\0),  the data that's written to the file is not the data
that is printed from the filter.  I've set up a basic filter to simply send
the data it reads on to the next stage in order to troubleshoot:

while($f-read(my $buffer, 16)) {
   print STDERR unpack('H*', $buffer), \n;
   $f-print($buffer)
}

but I can't seem to get it to work.  Here is an example via a telnet
session:

  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  PUT /members/jeff/test HTTP/1.1
  Host: 127.0.0.1:9080
  Content-Length: 11

  [EMAIL PROTECTED]
  HTTP/1.1 204 No Content
  Date: Mon, 15 Mar 2004 20:51:26 GMT
  Server: Apache/2.0.48 (Unix)
  Content-Length: 0
  Connection: close
  Content-Type: text/plain; charset=ISO-8859-1


The filter seems to be sending the correct data along:
  [EMAIL PROTECTED] jeff]# tail /usr/local/apache2/logs/error_log
  3132330134353600373839

  1 2 3 \1 4 5 6 \0 7 8 9

but the file does not have the correct data:

  [EMAIL PROTECTED] jeff]# od -x test
  000 3231 0133 3534 0036 0001 
  013

Any help would be greatly appreciated.



-- 
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: [mp2] Trouble with Apache::Filter input and mod_dav

2004-03-15 Thread Jeff Finn
Thanks.  This fixes the problem I was having.

Jeff


-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 7:52 PM
To: Stas Bekman
Cc: Jeff Finn; [EMAIL PROTECTED]
Subject: Re: [mp2] Trouble with Apache::Filter input and mod_dav


Stas Bekman wrote:
 Jeff Finn wrote:

 Hi,

 I'm trying to write an input filter that will read the request body
 data, do
 some transformation, and then write the output to a file using mod_dav:

 Location /davtest/
 DAV on
 PerlInputFilterHandlerFileDataLog::input
 /Location

 The problem I'm having is that whenever I try to PUT a file that contains
 null characters (\0),  the data that's written to the file is not the
 data
 that is printed from the filter.
[...]

Jeff,

The patch below should fix the problem. It'll be in cvs shortly. Please
confirm that it worked for you.

Index: src/modules/perl/modperl_filter.c
===
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.86
diff -u -r1.86 modperl_filter.c
--- src/modules/perl/modperl_filter.c   4 Mar 2004 06:01:07 -   1.86
+++ src/modules/perl/modperl_filter.c   16 Mar 2004 00:50:30 -
@@ -783,7 +783,7 @@
apr_size_t *len)
  {
  apr_bucket_alloc_t *ba = filter-f-c-bucket_alloc;
-char *copy = apr_pstrndup(filter-pool, buf, *len);
+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


--
__
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


-- 
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