// header too?
if (hbp.length()) {
// be sneaky: include the header in the second fragment
- second.push_front(hbp);
+ bufferlist tmp;
+ tmp.push_back(hbp);
+ tmp.claim_append(second);
+ second.swap(tmp);
pos = 0; // we included the header
}
// Write the second portion first possible with the header, so
assert(pos == header.max_size);
if (hbp.length()) {
// be sneaky: include the header in the second fragment
- second.push_front(hbp);
+ bufferlist tmp;
+ tmp.push_back(hbp);
+ tmp.claim_append(second);
+ second.swap(tmp);
pos = 0; // we included the header
} else
pos = get_top(); // no header, start after that