From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- karm/test/__webdav.pl | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 karm/test/__webdav.pl (limited to 'karm/test/__webdav.pl') diff --git a/karm/test/__webdav.pl b/karm/test/__webdav.pl new file mode 100755 index 000000000..b09875755 --- /dev/null +++ b/karm/test/__webdav.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl -w + +# This script requires the following Perl modules: +# +# $ perl -MCPAN -e 'shell' +# cpan> install Net::DAV::Server +# cpan> install Filesys::Virtual::Plain +# cpan> install File::Find::Rule::Filesys::Virtual +# cpan> install XML::LibXML +# +# The last Perl module needs the libxml2 development libraries installed +# (the libxml2-dev package on Debian). + +use Net::DAV::Server; +use Filesys::Virtual::Plain; +use HTTP::Daemon; + +# If 1, output request and response headers +my $DEBUG=0; + +my $filesys = Filesys::Virtual::Plain->new(); +$filesys->root_path('/tmp'); +$filesys->cwd('/tmp'); +#print foreach ($filesys->list('/')); + +my $webdav = Net::DAV::Server->new(); +$webdav->filesys($filesys); + +my $d = new HTTP::Daemon + LocalAddr => 'localhost', + LocalPort => 4242, + ReuseAddr => 1 || die; +print "Please contact me at: ", $d->url, "\n"; +while (my $c = $d->accept) { + while (my $request = $c->get_request) { + if ( $DEBUG ) { + print qq|------------------------------------------------------------ +REQUEST +------------------------------------------------------------\n|; + while ( ($k,$v) = each %{$request} ) { + print " $k => $v\n"; + } + } + my $response = $webdav->run($request); + if ( $DEBUG ) { + print qq|------------------------------------------------------------ +RESPONSE +------------------------------------------------------------\n|; + while ( ($k,$v) = each %{$response} ) { + print " $k => $v\n"; + } + } + $c->send_response ($response); + } + $c->close; + undef($c); +} -- cgit v1.2.1