From 0133da1dcdaba9654e79506c4baeed506b6a4e30 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 17 Sep 2013 15:33:34 -0400 Subject: Get rid of onSent(), which was never used consistently anyway. --- node/Peer.cpp | 11 ----------- node/Peer.hpp | 14 -------------- node/Switch.cpp | 18 ++++-------------- 3 files changed, 4 insertions(+), 39 deletions(-) diff --git a/node/Peer.cpp b/node/Peer.cpp index 488fde0c..7fd33ce9 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -99,17 +99,6 @@ bool Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,u return false; } -void Peer::onSent(const RuntimeEnvironment *_r,bool relay,Packet::Verb verb,uint64_t now) -{ - if (verb == Packet::VERB_FRAME) { - _lastUnicastFrame = now; - _dirty = true; - } else if (verb == Packet::VERB_MULTICAST_FRAME) { - _lastMulticastFrame = now; - _dirty = true; - } -} - bool Peer::sendFirewallOpener(const RuntimeEnvironment *_r,uint64_t now) { bool sent = false; diff --git a/node/Peer.hpp b/node/Peer.hpp index f1ea653c..cab9319b 100644 --- a/node/Peer.hpp +++ b/node/Peer.hpp @@ -135,20 +135,6 @@ public: */ bool send(const RuntimeEnvironment *_r,const void *data,unsigned int len,uint64_t now); - /** - * Must be called after a packet is successfully sent to this peer - * - * Note that 'relay' means we've sent a packet *from* this node to this - * peer by relaying it, not that we have relayed a packet from somewhere - * else to this peer. In the latter case this is not called. - * - * @param _r Runtime environment - * @param relay If true, packet was sent indirectly via a relay - * @param verb Packet verb - * @param now Current time - */ - void onSent(const RuntimeEnvironment *_r,bool relay,Packet::Verb verb,uint64_t now); - /** * Send firewall opener to active link * diff --git a/node/Switch.cpp b/node/Switch.cpp index 92fb7876..0deece56 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -216,11 +216,7 @@ bool Switch::sendHELLO(const SharedPtr &dest,Demarc::Port localPort,const _r->identity.serialize(outp,false); outp.macSet(dest->macKey()); - if (_r->demarc->send(localPort,remoteAddr,outp.data(),outp.size(),-1)) { - dest->onSent(_r,false,Packet::VERB_HELLO,now); - return true; - } - return false; + return _r->demarc->send(localPort,remoteAddr,outp.data(),outp.size(),-1); } bool Switch::unite(const Address &p1,const Address &p2,bool force) @@ -274,8 +270,7 @@ bool Switch::unite(const Address &p1,const Address &p2,bool force) } outp.encrypt(p1p->cryptKey()); outp.macSet(p1p->macKey()); - if (p1p->send(_r,outp.data(),outp.size(),now)) - p1p->onSent(_r,false,Packet::VERB_RENDEZVOUS,now); + p1p->send(_r,outp.data(),outp.size(),now); } { // tell p2 where to find p1 Packet outp(p2,_r->identity.address(),Packet::VERB_RENDEZVOUS); @@ -290,8 +285,7 @@ bool Switch::unite(const Address &p1,const Address &p2,bool force) } outp.encrypt(p2p->cryptKey()); outp.macSet(p2p->macKey()); - if (p2p->send(_r,outp.data(),outp.size(),now)) - p2p->onSent(_r,false,Packet::VERB_RENDEZVOUS,now); + p2p->send(_r,outp.data(),outp.size(),now); } return true; @@ -616,10 +610,8 @@ Address Switch::_sendWhoisRequest(const Address &addr,const Address *peersAlread outp.macSet(supernode->macKey()); uint64_t now = Utils::now(); - if (supernode->send(_r,outp.data(),outp.size(),now)) { - supernode->onSent(_r,false,Packet::VERB_WHOIS,now); + if (supernode->send(_r,outp.data(),outp.size(),now)) return supernode->address(); - } } return Address(); } @@ -672,8 +664,6 @@ bool Switch::_trySend(const Packet &packet,bool encrypt) remaining -= chunkSize; } } - - via->onSent(_r,isRelay,packet.verb(),now); return true; } return false; -- cgit v1.2.3