cherokee / webserver

Cherokee Web Server
GNU General Public License v2.0
564 stars 104 forks source link

HTTP Reverse Proxy + Apache DAV 504 Gateway Timeout #1134

Open cacheuk opened 10 years ago

cacheuk commented 10 years ago

When using cherokee in front of an apache-svn (dav) server OPTIONS requests now result in 504 Gateway Timeout - this only appeared with the 1.2.104 release.

skinkie commented 10 years ago

It did before, I recall a bug about it. But it is good to investigate the cause.

cacheuk commented 10 years ago

interestingly its working fine in front of the same apache instance with downgrade to 1.2.103

skinkie commented 10 years ago

If you want to figure out by git bisect what change (re-)introduced the problem I would be very happy to hear about it.

cacheuk commented 10 years ago

cache@extropia~/cherokee [(no branch, bisect started on master)]$ git bisect good 322c670d717d83d9c9f2d597e43d62a5da675bac is the first bad commit commit 322c670d717d83d9c9f2d597e43d62a5da675bac Author: Stefan de Konink stefan@konink.de Date: Sat Jan 4 05:45:58 2014 +0100

strtoul will return ULONG_MAX in case of error, but in the rest of the code we are comparing errno.

:040000 040000 a460c080da4df8f7f6678d1dcbec3bd2add92580 76622c521b78a03cd2f48233f7e85f84763dd009 M cherokee

looks like the issue, have not had time to dig into it yet, FYI Content-Length header on the DAV OPTIONS request that hangs is Content-Length: 0

cacheuk commented 10 years ago

reverting of 322c670 does indeed fix the gateway timeout. whilst investigating this issue I also found that while svn 1.7.x works 1.8.x does not and returns 400 bad request errors on the apache side.

on further investigation it appears that between svn 1.7.x and 1.8.x http chunking was implemented so there may be an issue with proxying chunked requests. I was able to disable chunking on svn 1.8 (adding http-chunked-requests = no to the global section of ~/.subversion/servers on the client) and everything worked fine with the revert of 322c670