Changeset 6873 for source/ariba/overlay/BaseOverlay.cpp
- Timestamp:
- Nov 6, 2009, 11:50:18 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r6872 r6873 69 69 public: 70 70 ValueEntry( const Data& value ) : ttl(0), last_update(time(NULL)), 71 last_change(time(NULL)), value(value.clone()) {71 last_change(time(NULL)), value(value.clone()) { 72 72 } 73 73 … … 1138 1138 // resolve end-point descriptor from the base-overlay routing table 1139 1139 const EndpointDescriptor& ep = overlayInterface->resolveNode( node ); 1140 if(ep != EndpointDescriptor::UNSPECIFIED()) return ep;1140 if(ep.toString() != "") return ep; 1141 1141 1142 1142 // see if we can find the node in our own table … … 1144 1144 if(ld->remoteNode != node) continue; 1145 1145 const EndpointDescriptor& ep = bc->getEndpointDescriptor(ld->communicationId); 1146 if(ep.toString() .size()==0) continue;1146 if(ep.toString() == "") continue; 1147 1147 if(ep != EndpointDescriptor::UNSPECIFIED()) return ep; 1148 1148 } … … 2088 2088 } 2089 2089 2090 // re-publish values2090 // erase old values from local DHT 2091 2091 BOOST_FOREACH( DHTEntry& entry, localDHT->entries ) { 2092 2092 // erase old entries 2093 2093 entry.erase_expired_entries(); 2094 2095 // re-publish values 2094 } 2095 2096 // re-publish values 2097 BOOST_FOREACH( DHTEntry& entry, localDHT->entries ) { 2096 2098 BOOST_FOREACH( ValueEntry& value, entry.values ) 2097 2099 dhtPut(entry.key, value.get_value(), 0, true ); … … 2184 2186 // calculate hash 2185 2187 NodeID dest = NodeID::sha1(key.getBuffer(), key.getLength() / 8); 2186 DHTMessage dhtmsg( key,value);2187 dhtmsg.setReplace( replace);2188 DHTMessage dhtmsg( key, value ); 2189 dhtmsg.setReplace( replace ); 2188 2190 dhtmsg.setTTL(ttl); 2189 2191 2190 OverlayMsg msg( OverlayMsg::typeDHTPut);2192 OverlayMsg msg( OverlayMsg::typeDHTPut ); 2191 2193 msg.encapsulate( &dhtmsg ); 2192 2194 dhtSend(&msg, dest);
Note:
See TracChangeset
for help on using the changeset viewer.