[sheepdog] [PATCH stable-0.8 7/9] sheep/http: check http driver in http_init()

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Mar 6 08:12:42 CET 2014


From: Robin Dong <sanbai at taobao.com>

If users start sheep daemon like:

sheep -r host=127.0.0.1,port=8000 -c local

the sheep will startup normally, but when someone access
127.0.0.1:8000 by swift interface, it will get message of
"405 Method Not Allowed" without any explaination in sheep.log

So we use 'swift' as default http driver if users doesn't point out
in command line.

Signed-off-by: Robin Dong <sanbai at taobao.com>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/http/http.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sheep/http/http.c b/sheep/http/http.c
index 7b25651..cf658c6 100644
--- a/sheep/http/http.c
+++ b/sheep/http/http.c
@@ -394,6 +394,11 @@ int http_init(const char *options)
 	if (option_parse(s, ",", http_opt_parsers) < 0)
 		return -1;
 
+	if (list_empty(&http_enabled_drivers)) {
+		http_opt_default_parser("swift");
+		sd_debug("Use swift as default http driver");
+	}
+
 	sys->http_wqueue = create_work_queue("http", WQ_DYNAMIC);
 	if (!sys->http_wqueue)
 		return -1;
-- 
1.7.10.4




More information about the sheepdog mailing list