From f40ee925f06587399e3a1b755ede2ea87a7cc67f Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 3 Sep 2018 20:53:10 -0400 Subject: fix bug: rewinding send buffer should push to the front --- include/salticidae/conn.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index d93f787..53d51a3 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -104,7 +104,12 @@ class SegBuffer { } return *this; } - + + void rewind(bytearray_t &&data) { + _size += data.size(); + buffer.push_front(buffer_entry_t(std::move(data))); + } + void push(bytearray_t &&data) { _size += data.size(); buffer.push_back(buffer_entry_t(std::move(data))); -- cgit v1.2.3