| 426 | } |
| 427 | |
| 428 | bool disque::info(std::map<string, string>& out) |
| 429 | { |
| 430 | size_t argc = 1; |
| 431 | const char* argv[1]; |
| 432 | size_t lens[1]; |
| 433 | |
| 434 | argv[0] = "INFO"; |
| 435 | lens[0] = sizeof("INFO") - 1; |
| 436 | |
| 437 | build_request(argc, argv, lens); |
| 438 | string buf; |
| 439 | if (get_string(buf) <= 0) { |
| 440 | return false; |
| 441 | } |
| 442 | |
| 443 | string line; |
| 444 | while ((buf.scan_line(line))) { |
| 445 | const std::vector<string>& tokens = line.split2(":"); |
| 446 | if (tokens.size() != 2) { |
| 447 | line.clear(); |
| 448 | continue; |
| 449 | } |
| 450 | out[tokens[0]] = tokens[1]; |
| 451 | line.clear(); |
| 452 | } |
| 453 | |
| 454 | return true; |
| 455 | } |
| 456 | |
| 457 | const std::vector<disque_node*>* disque::hello() |
| 458 | { |