Patch for lighttpd MKCOL

Brad Fitzpatrick brad at danga.com
Tue Apr 24 20:37:56 UTC 2007


Thanks for the patch.  Will be (partially) included in 2.10 (the next
parts).

The 405 removal is a bit more difficult... I see from the WebDAV spec that
it's correct, but I'm afraid Perlbal/Apache might return 405 for other
reasons, besides directory-already-exists... like if WebDAV isn't enabled
to begin with.  Somehow I'll need to differentiate between those two
cases.  I'll add a note to the TODO to look into this more later...

- Brad


On Tue, 10 Apr 2007, Justin Huff wrote:

> I'm using lighttpd (mogstored was leaking mem badly, still need to
> investigate), but I noticed that the tracker wasn't able to create
> directories.
>
> The problem is that lighttpd returns a 405 when trying to create an
> existing dir.  This seems to be the proper behavior
> (http://www.webdav.org/specs/rfc2518.html#rfc.section.8.3.2).
>
> I was getting occasional 403s on PUTs immediately after a MKCOL. I
> expected that the problem was lighttpd's stat caching. I tried
> disabling, but I'm still getting them. Any ideas?
>
> I also noticed a lot of warnings about returning from a function with
> next.  Looks like that got missed in a refactoring.
>
>
> --Justin
>
> Index: server/lib/MogileFS/Device.pm
> ===================================================================
> --- server/lib/MogileFS/Device.pm       (revision 801)
> +++ server/lib/MogileFS/Device.pm       (working copy)
> @@ -362,7 +362,7 @@
>   sub create_directory {
>       my ($self, $uri) = @_;
>       return 1 if $self->doesnt_know_mkcol;
> -    next if $dir_made{$uri};
> +    return 0 if $dir_made{$uri};
>
>       my $hostid = $self->hostid;
>       my $host   = $self->host;
> @@ -378,7 +378,7 @@
>       my $ans = <$sock>;
>
>       # if they don't support this method, remember that
> -    if ($ans && $ans =~ m!HTTP/1\.[01] (400|405|501)!) {
> +    if ($ans && $ans =~ m!HTTP/1\.[01] (400|501)!) {
>           $self->{no_mkcol} = 1;
>           # TODO: move this into method on device, which propogates to
> parent
>           # and also receive from parent.  so all query workers share
> this knowledge
>
>


More information about the mogilefs mailing list