pub fn parse_command(buffer: &[u8]) -> ParsedExpand description
Try to take one command from the front of buffer.
Framing rules that matter, and that are easy to get wrong:
- Every command line ends with
\r\n. A bare\nis not accepted; upstream is lenient about this in places but a strict server keeps clients honest and keeps byte counting unambiguous. - A storage command is followed by exactly
<bytes>octets and then\r\n. The count is authoritative: the data block may itself contain\r\n, so scanning for a delimiter instead of counting is the classic memcached implementation bug.