]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
weird
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 2 Jul 2005 18:56:56 +0000 (18:56 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 2 Jul 2005 18:56:56 +0000 (18:56 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@382 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/include/buffer.h
ceph/include/bufferlist.h
ceph/msg/TCPMessenger.cc
ceph/tcpsyn.cc

index c35f01e7106b8550acb0a4b2227e5a68112d3fc4..933d41e72bec7b4f73ab11349ba1bc77f778df98 100644 (file)
@@ -196,6 +196,7 @@ class bufferptr {
 
   // assignment operator
   bufferptr& operator=(const bufferptr& other) {
+       assert(0);
        // discard old
        discard_buffer();
 
index b726cb2db6b8029378103d160523e64fa89f349e..94a1729bc2451fbd8090849cdacd713c74f3fa6c 100644 (file)
@@ -32,18 +32,21 @@ class bufferlist {
        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() { 
index f89412e60b92cb0cae030a3a58db04fbb96c2543..4cfb3c5a1c0335b03edfe54ccaa83544dee48bf5 100644 (file)
@@ -349,7 +349,9 @@ int tcp_send(Message *m)
   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
index 1b2281eaea9b13a38699a5ae51ec19881497f1c7..c80e8f0e224fc8d71570b6d12aac6cac0e4419b1 100644 (file)
@@ -93,7 +93,7 @@ int main(int oargc, char **oargv) {
   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)