Changeset 6919 for source/ariba/overlay
- Timestamp:
- Nov 13, 2009, 1:41:34 PM (15 years ago)
- Location:
- source/ariba/overlay
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r6916 r6919 148 148 static bool equals( const Data& lhs, const Data& rhs ) { 149 149 if (rhs.getLength()!=lhs.getLength()) return false; 150 for ( int i=0; i<lhs.getLength()/8; i++)150 for (size_t i=0; i<lhs.getLength()/8; i++) 151 151 if (lhs.getBuffer()[i] != rhs.getBuffer()[i]) return false; 152 152 return true; … … 604 604 message->setDestinationNode(remote); 605 605 message->setService(service); 606 send( message, remote );606 return send( message, remote ); 607 607 } 608 608 … … 747 747 748 748 BaseOverlay::BaseOverlay() : 749 bc(NULL), overlayInterface(NULL), nodeId(NodeID::UNSPECIFIED), 750 spovnetId(SpoVNetID::UNSPECIFIED), state(BaseOverlayStateInvalid), 751 sideport(&SideportListener::DEFAULT), started(false), counter(0) { 749 started(false),state(BaseOverlayStateInvalid), 750 bc(NULL), 751 nodeId(NodeID::UNSPECIFIED), spovnetId(SpoVNetID::UNSPECIFIED), 752 sideport(&SideportListener::DEFAULT), overlayInterface(NULL), 753 counter(0) { 752 754 dht = new DHT(); 753 755 localDHT = new DHT(); … … 1158 1160 sideport = _sideport; 1159 1161 _sideport->configure( this ); 1162 return true; 1160 1163 } 1161 1164 1162 1165 bool BaseOverlay::unregisterSidePort(SideportListener* _sideport) { 1163 1166 sideport = &SideportListener::DEFAULT; 1167 return true; 1164 1168 } 1165 1169 … … 1789 1793 // erase the original descriptor 1790 1794 eraseDescriptor(ld->overlayId); 1795 return true; 1791 1796 } 1792 1797 … … 2182 2187 void BaseOverlay::dhtPut( const Data& key, const Data& value, int ttl, bool replace, bool no_local_refresh ) { 2183 2188 2184 logging_info("DHT: putting key=" << key 2185 << " value=" << value 2186 << " ttl=" << ttl 2187 << " replace=" << replace 2189 logging_info("DHT: putting key=" << key << " value=" << value 2190 << " ttl=" << ttl << " replace=" << replace 2188 2191 ); 2189 2192 -
source/ariba/overlay/OverlayBootstrap.h
r5967 r6919 106 106 nodeid = rhs.nodeid; 107 107 endpoint = rhs.endpoint; 108 return *this; 108 109 } 109 110 -
source/ariba/overlay/messages/DHTMessage.cpp
r6835 r6919 10 10 DHTMessage::DHTMessage() { 11 11 this->key.setLength(0); 12 this->ttl = 0;12 this->ttl = 0; 13 13 this->replace = false; 14 14 } … … 18 18 this->hash = NodeID::sha1( key.getBuffer(), key.getLength() / 8 ); 19 19 this->key = key.clone(); 20 this->ttl = 0;20 this->ttl = 0; 21 21 this->replace = false; 22 22 } … … 26 26 this->hash = NodeID::sha1( key.getBuffer(), key.getLength() / 8 ); 27 27 this->key = key.clone(); 28 this->values.push_back( 29 this->ttl = 0;28 this->values.push_back( value.clone() ); 29 this->ttl = 0; 30 30 this->replace = false; 31 31 } 32 32 33 33 DHTMessage::DHTMessage( const Data& key, const vector<Data>& values ) { 34 this->hash = NodeID::sha1( key.getBuffer(), key.getLength() / 8 ); 34 35 this->key = key.clone(); 35 36 BOOST_FOREACH(const Data value, values ) 36 this->values.push_back( value.clone() ); 37 this->values.push_back( value.clone() ); 38 this->ttl = 0; 37 39 this->replace = false; 38 40 } -
source/ariba/overlay/messages/DHTMessage.h
r6835 r6919 33 33 34 34 bool hasValues() const { 35 values.size() != 0;35 return values.size() != 0; 36 36 } 37 37 -
source/ariba/overlay/messages/OverlayMsg.h
r6266 r6919 213 213 uint8_t increaseNumHops() { 214 214 hops++; 215 return hops; 215 216 } 216 217 -
source/ariba/overlay/modules/OverlayInterface.h
r6854 r6919 179 179 BaseOverlay& baseoverlay; 180 180 181 /// The parameters of the overlay structure182 OverlayParameterSet parameters;183 184 181 /// The node identifier to use with this overlay 185 182 const NodeID& nodeid; … … 187 184 /// The listener used to inform about overlay structure changes 188 185 OverlayStructureEvents* eventsReceiver; 186 187 /// The parameters of the overlay structure 188 OverlayParameterSet parameters; 189 189 190 190 /// The service identifer of this overlay -
source/ariba/overlay/modules/chord/Chord.cpp
r6854 r6919 79 79 80 80 // check if we already have a connection 81 for ( int i=0; i<table->size(); i++)81 for (size_t i=0; i<table->size(); i++) 82 82 if ((*table)[i]->ref_count > 0 && (*table)[i]->id == remote && !((*table)[i]->info.isUnspecified())) 83 83 return LinkID::UNSPECIFIED; … … 291 291 292 292 // handle messages 293 switch ( m->getType()) {293 switch ((signalMessageTypes)m->getType()) { 294 294 295 295 // discovery request … … 317 317 setup( dmsg->getEndpoint(), m->getSourceNode() ); 318 318 319 // delegate discovery message319 // process discovery message -------------------------- switch start -- 320 320 switch (dmsg->getType()) { 321 321 … … 388 388 baseoverlay.send(&omsg, omsg.getDestinationNode()); 389 389 break; 390 }} 390 } 391 case Discovery::invalid: 392 break; 393 394 default: 395 break; 396 } 397 // process discovery message ---------------------------- switch end -- 398 391 399 delete dmsg; 392 400 break; … … 426 434 // updating neighbors 427 435 logging_debug("Discover new ring neighbors"); 428 for ( int i=0; i<table->size(); i++) {436 for (size_t i=0; i<table->size(); i++) { 429 437 LinkID id = (*table)[i]->info; 430 438 if (!id.isUnspecified()) discover_neighbors(id); -
source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp
r5902 r6919 92 92 private: 93 93 // maximum number of fingers 94 static const int max_fingers = 32;94 static const size_t max_fingers = 32; 95 95 96 96 // the own node id -
source/ariba/overlay/modules/onehop/OneHop.cpp
r6266 r6919 241 241 if( onemsg->isType( OneHopMessage::OneHopMessageTypeListingRequest ) ){ 242 242 243 NodeListingRequest* request = onemsg->decapsulate<NodeListingRequest>();243 //NodeListingRequest* request = onemsg->decapsulate<NodeListingRequest>(); 244 244 245 245 logging_info( "onehop received node listing request from node " << remote.toString() );
Note:
See TracChangeset
for help on using the changeset viewer.