From: Kefu Chai Date: Sun, 16 Feb 2020 11:05:09 +0000 (+0800) Subject: crimson/admin: no need to check for '\n' X-Git-Tag: v15.1.1~398^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d557a97ed667db6aa8e8dbe0703a1a8aee29a12;p=ceph.git crimson/admin: no need to check for '\n' 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 --- diff --git a/src/crimson/admin/admin_socket.cc b/src/crimson/admin/admin_socket.cc index d89a0918890c..2d0131c3f887 100644 --- a/src/crimson/admin/admin_socket.cc +++ b/src/crimson/admin/admin_socket.cc @@ -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::stop_consuming_type(std::move(buf)));