Hello all,

The cherokee bug tracker [0] seems to be misbehaving, so in it's absence:

I recently looked at serving bazaar-ng branches via http with cherokee
(using the 'common' handler). I noticed that cloning any branches via
http was failing. When branching via http, bzr bases its behaviour on
the presence of certain files in it's control directory (e.g.
.bzr/checkout/format). It seems that cherokee doesn't send a 404 in
the absence of these files, redirecting instead to the root directory,
breaking bzr.

I've verfied this behaviour is present in 0.5.6 and trunk. I've
attached a small patch (against trunk) for common_handler.c that just
emits a 'http_not_found' error code instead of redirecting when a
file/dir is absent. This allows bzr to operate as expected.

Perhaps redirection behaviour like this should be left to the user to configure?

Thanks,
Eoin

[0] http://www.cherokee-project.com/bugs/
Index: handler_common.c
===================================================================
--- handler_common.c	(revision 942)
+++ handler_common.c	(working copy)
@@ -177,35 +177,9 @@
 	       conn->request.buf, conn->local_directory.buf, exists);
 	
 	if (!exists) {
-		ret_t  ret;
-		char  *pathinfo;
-		int    pathinfo_len;
-		int    begin;
-
-		/* Maybe it could stat() the file because the request contains
-		 * a PathInfo string at the end..
-		 */
-		begin = conn->local_directory.len - conn->request.len;
-		
-		ret = cherokee_split_pathinfo (&conn->local_directory, begin, true, &pathinfo, &pathinfo_len);
-		if ((ret == ret_not_found) || (pathinfo_len <= 0)) {
-			cherokee_iocache_mmap_release (iocache, file);
-			conn->error_code = http_not_found;
-			return ret_error;
-		}
-		
-		/* Copy the PathInfo and clean the request 
-		 */
-		cherokee_buffer_add (&conn->pathinfo, pathinfo, pathinfo_len);
-		cherokee_buffer_drop_endding (&conn->request, pathinfo_len);
-
-		/* Clean the local_directory, this connection is going
-		 * to restart the connection setup phase
-		 */
-		cherokee_buffer_clean (&conn->local_directory);
-
 		cherokee_iocache_mmap_release (iocache, file);
-		return ret_eagain;
+		conn->error_code = http_not_found;
+		return ret_error;
 	}	
 
 	cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len);
_______________________________________________
Cherokee mailing list
[email protected]
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to