]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
config: fix address list parsing
authorSage Weil <sage@newdream.net>
Tue, 5 Oct 2010 22:37:39 +0000 (15:37 -0700)
committerSage Weil <sage@newdream.net>
Tue, 5 Oct 2010 22:47:04 +0000 (15:47 -0700)
Skip past comma, whitespace.

Signed-off-by: Sage Weil <sage@newdream.net>
src/config.cc

index 412670a126793da1bacd4dae53cec9e876d608c0..cc7df278903a1175ac494b0d6568482a32a7feef 100644 (file)
@@ -178,9 +178,15 @@ bool parse_ip_port_vec(const char *s, vector<entity_addr_t>& vec)
   const char *end = p + strlen(p);
   while (p < end) {
     entity_addr_t a;
-    if (!a.parse(p, &p))
+    //cout << " parse at '" << p << "'" << std::endl;
+    if (!a.parse(p, &p)) {
+      //dout(0) << " failed to parse address '" << p << "'" << dendl;
       return false;
+    }
+    //cout << " got " << a << ", rest is '" << p << "'" << std::endl;
     vec.push_back(a);
+    while (*p == ',' || *p == ' ')
+      p++;
   }
   return true;
 }