Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor fixes

  • Loading branch information...
commit e14f25bcc380dca2ec3622240db0d4eaede51c35 1 parent 3e43529
@vshymanskyy authored
View
1  bsp.cfg
@@ -1,2 +1 @@
-vshymanskyy.org.ua:7777
localhost:7777
View
2  src/KadContact.h
@@ -49,7 +49,9 @@ struct KadContact
return free(ptr);
}
*/
+
bool IsStale() const { return mFailQty >= KADEMLIA_STALE; }
+ bool BecameStale() const { return mFailQty == KADEMLIA_STALE; }
};
typedef std::tr1::shared_ptr<KadContact> KadContactPtr;
View
7 src/KadOpMgr.h
@@ -16,7 +16,6 @@
#include "KadMsg.h"
#include "KadOverIP.h"
-#include "KadIterativeFind.h"
#include <iostream>
#include <map>
@@ -84,7 +83,7 @@ class KadOpMgr {
void Start() {
int sentQty = Send(KADEMLIA_ALPHA);
- LOG(mMgr->mLog, FMT("Started node lookup: %d sent", sentQty));
+ LOG_DEEP(mMgr->mLog, FMT("Started node lookup: %d sent", sentQty));
}
void OnResponce(const msgpack::object* rsp, KadContactPtr& contact) {
@@ -98,7 +97,9 @@ class KadOpMgr {
if (!rsp) {
if (contact->IsStale()) {
- LOG(mMgr->mLog, "Stale: " << contact->mAddrExt.ToString());
+ if (contact->BecameStale()) {
+ LOG(mMgr->mLog, "Stale: " << contact->mAddrExt.ToString());
+ }
KadContactList::It n = mList.FindAfter(mList.First(), contact);
if (n != mList.End()) {
View
10 src/KadRtNode.h
@@ -255,15 +255,15 @@ class TKadRtNode
}
void PrintDot(std::ostream& s) const {
- TKadId<KadId::SIZE+1> rangeSize = TKadId<KadId::SIZE+1>::PowerOfTwo(KadId::BIT_SIZE-mDepth);
+ //TKadId<KadId::SIZE> rangeSize = TKadId<KadId::SIZE>::PowerOfTwo(KadId::BIT_SIZE-mDepth);
if (IsBucket()) {
s << '"' << this << '"';
s << " [shape=record, style=filled, fillcolor=skyblue, label=\"{";
s << "{index:" << mIndex << "|depth:" << mDepth << "}";
- s << "|{size:" << rangeSize.ToString() << "}";
- s << "|{[" << (rangeSize*mIndex).ToString() << "; " << (rangeSize*(mIndex+1)).ToString() << ")}";
+ //s << "|{size:" << rangeSize.ToString() << "}";
+ //s << "|{[" << (rangeSize*mIndex).ToString() << "; " << (rangeSize*(mIndex+1)).ToString() << ")}";
s << "|{Contacts (" << mContacts.Count() << ")}";
for (KadContactList::It it = mContacts.First(); it != mContacts.End(); ++it) {
@@ -281,8 +281,8 @@ class TKadRtNode
s << "{index:" << mIndex << "|depth:" << mDepth << "}";
s << "|{local:" << mLocalId.ToString() << "}";
- s << "|{size:" << rangeSize.ToString() << "}";
- s << "|{[" << (rangeSize*mIndex).ToString() << "; " << (rangeSize*(mIndex+1)).ToString() << ")}";
+ //s << "|{size:" << rangeSize.ToString() << "}";
+ //s << "|{[" << (rangeSize*mIndex).ToString() << "; " << (rangeSize*(mIndex+1)).ToString() << ")}";
s << "}\"]" << std::endl;
Please sign in to comment.
Something went wrong with that request. Please try again.