aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2018-09-03 20:53:10 -0400
committerDeterminant <ted.sybil@gmail.com>2018-09-03 20:53:10 -0400
commitf40ee925f06587399e3a1b755ede2ea87a7cc67f (patch)
treedeb85ed2cb05b54448438e4f1181273ff8418056 /include
parent3145cb1ae49ef94aecf8688329545e912e67a25f (diff)
fix bug: rewinding send buffer should push to the front
Diffstat (limited to 'include')
-rw-r--r--include/salticidae/conn.h7
1 files changed, 6 insertions, 1 deletions
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)));