[sheepdog] [PATCH] sheep: set the length of response in local_get_store_list()

Hitoshi Mitake h.mitake at gmail.com
Sun Oct 28 08:08:24 CET 2012


The commit: 55a84a160dca3c8ed656e21d85fbe93c82e731a9 reduced the
setting of default length of response, so the result of
local_get_store_list() wasn't sent to collie.

Current output of "collie cluster format -b asdf" is:
using backend asdf store
Format failed: Targeted backend store is not found
Available stores:
---------------------------------------

Correct output is:
using backend asdf store
Format failed: Targeted backend store is not found
Available stores:
plain farm
---------------------------------------

This patch let local_get_store_list() set the length of response.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/ops.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index df4831b..45bba43 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -369,7 +369,7 @@ static int local_get_store_list(struct request *req)
 	list_for_each_entry(driver, &store_drivers, list) {
 		strbuf_addf(&buf, "%s ", driver->name);
 	}
-	strbuf_copyout(&buf, req->data, req->data_length);
+	req->rp.data_length = strbuf_copyout(&buf, req->data, req->data_length);
 
 	strbuf_release(&buf);
 	return SD_RES_SUCCESS;
-- 
1.7.5.1




More information about the sheepdog mailing list