my $r = shift;
my $dbh = Sesse::pr0n::Common::get_dbh();
- # We ignore the body, but we _must_ consume it fully before
- # we output anything, or Squid will get seriously confused
- $r->discard_request_body;
-
$r->headers_out->{'DAV'} = "1,2";
# We only handle depth=0, depth=1 (cf. the RFC)
# Directory listings et al
if ($r->method eq "PROPFIND") {
+ # We ignore the body, but we _must_ consume it fully before
+ # we output anything, or Squid will get seriously confused
+ $r->discard_request_body;
+
$r->content_type('text/xml; charset="utf-8"');
$r->status(207);
</propstat>
</response>
EOF
- $r->log->info("Full list");
}
$r->print("</multistatus>\n");
{
# Enable transactions and error raising temporarily
local $dbh->{AutoCommit} = 0;
-
local $dbh->{RaiseError} = 1;
+ my $fname;
# Try to insert this new file
eval {
undef, $newid, $event, $user, $takenby, $filename);
# Now save the file to disk
- my $fname = Sesse::pr0n::Common::get_disk_location($r, $newid);
+ $fname = Sesse::pr0n::Common::get_disk_location($r, $newid);
open NEWFILE, ">$fname"
or die "$fname: $!";
# Some error occurred, rollback and bomb out
$dbh->rollback;
dberror($r, "Transaction aborted because $@");
+ unlink($fname);
}
}