]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: always set the outstrlen for rados_ping_monitor() 8629/head
authorKefu Chai <kchai@redhat.com>
Sat, 16 Apr 2016 18:47:36 +0000 (02:47 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 16 Apr 2016 18:47:37 +0000 (02:47 +0800)
should set outstrlen even if the returned payload is empty. and we do
handle the empty string in do_out_buffer().

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librados/librados.cc

index 05dfac509f712710513f5aaddc8452668caae07f..096f0d7654883470fcf20d2f7296ea2478e04502 100644 (file)
@@ -2966,7 +2966,7 @@ extern "C" int rados_ping_monitor(rados_t cluster, const char *mon_id,
   }
 
   int ret = client->ping_monitor(mon_id, &str);
-  if (ret == 0 && !str.empty() && outstr && outstrlen) {
+  if (ret == 0) {
     do_out_buffer(str, outstr, outstrlen);
   }
   tracepoint(librados, rados_ping_monitor_exit, ret, ret < 0 ? NULL : outstr, ret < 0 ? NULL : outstrlen);