]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/WebDAV.pm
When using WebDAV, make sure the entire body is in before we start sending
[pr0n] / perl / Sesse / pr0n / WebDAV.pm
index 35cc9790bc0c1a7ec629a1499ee450fd16d5f91d..a391c076928f0d0fef5df1dddae83b4a02eb21bf 100644 (file)
@@ -9,6 +9,10 @@ use MIME::Base64;
 sub handler {
        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";
 
@@ -484,7 +488,7 @@ EOF
                                # Make cache while we're at it.
                                # Don't do it for the resource forks Mac OS X loves to upload :-(
                                if ($filename !~ /^\._/) {
-                                       Sesse::pr0n::Common::ensure_cached($r, $filename, $newid, -1, -1, 1, 80, 64, 320, 256);
+                                       Sesse::pr0n::Common::ensure_cached($r, $filename, $newid, -1, -1, 1, 80, 64, 320, 256, -1, -1);
                                }
                                
                                # OK, we got this far, commit