diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-13 09:12:35 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-13 09:12:35 +0300 |
commit | 24477805418533613d20c215575fb870ebcb61e6 (patch) | |
tree | ac1c12b55070cd0be5f68c9cfa45f90fb432d76e /client/transport.hpp | |
parent | don't let the write buffer corrupt (diff) | |
download | math-server-24477805418533613d20c215575fb870ebcb61e6.tar.gz math-server-24477805418533613d20c215575fb870ebcb61e6.zip |
client: skip \r
Diffstat (limited to '')
-rw-r--r-- | client/transport.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/transport.hpp b/client/transport.hpp index ae56f73..6311edd 100644 --- a/client/transport.hpp +++ b/client/transport.hpp @@ -83,9 +83,9 @@ private: } std::string read_line() { - const auto bytes = boost::asio::read_until(m_socket, m_buffer, '\n'); + const auto bytes = boost::asio::read_until(m_socket, m_buffer, "\r\n"); const auto data = boost::asio::buffer_cast<const char*>(m_buffer.data()); - const std::string result{data, bytes - 1}; + const std::string result{data, bytes - 2}; // Skip \r\n m_buffer.consume(bytes); return result; } |