bdbout(1) << "bufferlist.cons " << this << endl;
}
bufferlist(bufferlist& bl) : _len(0) {
- bdbout(1) << "bufferlist.cons " << this << endl;
+ bdbout(1) << "bufferlist.cons " << this << endl; // O(n) and stupid!
_buffers = bl._buffers;
_len = bl._len;
}
~bufferlist() {
bdbout(1) << "bufferlist.des " << this << endl;
}
- /*
+
bufferlist& operator=(bufferlist& bl) {
- assert(0); // actually, this should be fine.
+ assert(0); // actually, this should be fine, just slow (O(n)) and stupid.
+ _buffers = bl._buffers;
+ _len = bl._len;
+ return *this;
}
- */
+
// accessors
list<bufferptr>& buffers() {
m->reset_payload();
m->encode_payload();
msg_envelope_t *env = &m->get_envelope();
- bufferlist blist = m->get_payload();
+ bufferlist blist;
+ blist.claim( m->get_payload() );
+
#ifdef TCP_KEEP_CHUNKS
env->nchunks = blist.buffers().size();
#else
int world = tcpmessenger_world();
//cerr << "horrible hack remove me" << endl;
- //if (myrank == 0) g_conf.debug_filer = 15;
+ //if (myrank == 0) g_conf.debug = 10;
if (myrank == 0)