]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 27 Jun 2005 16:58:13 +0000 (16:58 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 27 Jun 2005 16:58:13 +0000 (16:58 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@346 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/msg/Messenger.cc
ceph/msg/Messenger.h
ceph/msg/TCPMessenger.cc

index bc4121ac6c1ab50bbf5999aa426256ec872676c3..545cc76d0affc59426284333a4f7d49a4a772bd3 100644 (file)
@@ -129,7 +129,7 @@ Message *Messenger::sendrecv(Message *m, msg_addr_t dest, int port)
         This should be fine. only the Client uses this so far (not MDS).
         If OSDs want to use this, though, this must be made smarter!!!
   */
-  long pcid = ++last_pcid;
+  long pcid = ++_last_pcid;
   m->set_pcid(pcid);
 
   _lock.Lock();
index 08229846269459c971a7a7681b0cadc1dccd38f6..8f1026cf9899383db7d648f9475d3b08537d545c 100644 (file)
@@ -21,13 +21,13 @@ class Messenger {
   msg_addr_t           _myaddr;
 
   // procedure call fun
-  long last_pcid;
+  long                   _last_pcid;
   Mutex                  _lock;      // protect call_sem, call_reply
   map<long, Cond*>       call_cond;
   map<long, Message*>    call_reply;
 
  public:
-  Messenger(msg_addr_t w) : dispatcher(0), _myaddr(w) { }
+  Messenger(msg_addr_t w) : dispatcher(0), _myaddr(w), _last_pcid(1) { }
   virtual ~Messenger() { }
   
   msg_addr_t get_myaddr() { return _myaddr; }
index c409e1afb742e264b5006b9ff7f4f6f80344ead9..bdb904a6e073a2d420b64831aaec93a470cdb16f 100644 (file)
@@ -219,6 +219,9 @@ void tcp_write(int sd, char *buf, int len)
   //dout(DBL) << "tcp_write writing " << len << endl;
   while (len > 0) {
        int did = ::send( sd, buf, len, 0 );
+       if (did < 0) {
+         dout(1) << "tcp_write error did = " << did << "  errno " << errno << " " << strerror(errno) << endl;
+       }
        assert(did >= 0);
        len -= did;
        buf += did;
@@ -436,6 +439,9 @@ int tcp_send(Message *m)
   }
 
   sender_lock.Unlock();
+
+  // hose message
+  delete m;
 }