Forum

sabre/dav (owncloud) and EnableAlter & MaxUploadSize

pasdVn
24 January 2016, 14:47
Hi :-)

i'm trying to use sabre/dav (the php WebDAV framework behind owncloud) with hiawatha. I had some problems with uploading big files when I configured WebDAVapp=on, EnableAlter=on and WebDAVapp=200. In this case the upload is interrupted with "500 internal server error" and i get an "error while forking CGI process" in hiawathas error-log. If I have a look at pstree afterwards, I see hiawatha and an zombie php-cgi process.

After some debugging I discovered, that an SIGPIPE is emitted when hiawatha tries to do the write() to the cgi pipe (in libfs.c, Line 676).

I found out, that it works flawless, if I set EnableAlter=off and MaxRequestSize= 204800 (should be 200MB) - which I really did not expect, as the man page says this will disable PUT and DELETE (after having a look in the code this is only true if WebDAVapp is also disabled).

So probably I will use this configuration, but maybe someone could clarify, if this is a kind of bug (maybe also in sabre/dav - I did not get any php error logs at all...) or if it is really not intended to use EnableAlter=on in combination with WebDAVapp=on and then use MaxRequestSize for all request types (if yes any hint in the man pages would be great ).
pasdVn
24 January 2016, 18:00
Update: Now I noticed, that with EnableAlter=off the whole "PUT" is kept in memory and is not stored temporary in WorkDirectory. This is not what I need , as I want to use hiawatha at an embedded device with little memory...

Some more infos I forgot to mention:
* hiawatha v10.0
* sabre/dav 3.1
* php 5.5.9

If i am using fastcgi (with a running php5-fpm) it works!
Hugo Leisink
24 January 2016, 20:07
If you want Hiawatha to serve a DAV application, you don't need the EnableAlter option. That option makes Hiawatha handle the PUT and DELETE methods itself. All you need is WebDAVapp = yes.

Yes, Hiawatha will buffer the request in memory. That's because it needs to access it for all kinds of security options that can be set. In my opinion, DAV is an abuse of the HTTP protocol. A web server was never intended to be a file server. With Hiawatha, I focused on writing a web server, not a file server. So, DAV will work, but Hiawatha is not optimized for it.
pasdVn
27 January 2016, 21:54
Hmm, o.k. I see. Thank you for clarification.
So it is correct/intended in some way's, that is is not working with this configuration?

But wouldn't it (theoretically) be possible to cache large PUT requests in the upload directory in WebDAV-Mode as well, before it get's passed to the cgi-interface? I think this how other webservers like lighttpd are handling this.
What is the difference from the security point of view compared to the the http-PUT that is handled by hiawatha itself (so EnableAlter=on, WEbDAV=off) where the caching on disk is done?

Btw.: It is not working with fastcgi, too - I did a mistake during my tests - the uploaded files have a size of 0 byte in this case.
This topic has been closed.