]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/admin: no need to check for '\n'
authorKefu Chai <kchai@redhat.com>
Sun, 16 Feb 2020 11:05:09 +0000 (19:05 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 16 Feb 2020 15:59:30 +0000 (23:59 +0800)
as we don't need to mimic the behavior of classic OSD, what we need to
to fulfill the needs of ceph cli. see `admin_socket()` in
`src/pybind/ceph_daemon.py`, which sends a `\0` to indicate the end of a
command.

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

index d89a0918890c5ae494026159145d4dc16a43e7f7..2d0131c3f887ab5869d12b4deb8771440ff6e0fe 100644 (file)
@@ -168,7 +168,7 @@ struct line_consumer {
     size_t consumed = 0;
     for (auto c : buf) {
       consumed++;
-      if (c == '\0' || c == '\n') {
+      if (c == '\0') {
        buf.trim_front(consumed);
        return seastar::make_ready_future<consumption_result_type>(
          consumption_result_type::stop_consuming_type(std::move(buf)));