summaryrefslogtreecommitdiff
path: root/node/Peer.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-04-10 11:17:54 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-04-10 11:17:54 -0700
commitb117ff54358d4e2b6b8eae4bd5300464f377d948 (patch)
tree3329edee4e08e39e8cfa4c4d4f8cf6aa1b349ffb /node/Peer.cpp
parent119ef5ecbf5653ddf497666e18894fa148cc2e9b (diff)
downloadinfinitytier-b117ff54358d4e2b6b8eae4bd5300464f377d948.tar.gz
infinitytier-b117ff54358d4e2b6b8eae4bd5300464f377d948.zip
Probable fix for GitHub issue #63 - do not unite() if either path is TCP, since doing so can result in asymmetric failed NAT-t over UDP if one side has a firewall that permits outgoing UDP but not incoming.
Diffstat (limited to 'node/Peer.cpp')
-rw-r--r--node/Peer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp
index 86a0da0f..5c87275f 100644
--- a/node/Peer.cpp
+++ b/node/Peer.cpp
@@ -117,7 +117,7 @@ void Peer::receive(
_lastMulticastFrame = now;
}
-bool Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,uint64_t now)
+Path::Type Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,uint64_t now)
{
Mutex::Lock _l(_lock);
@@ -164,9 +164,9 @@ bool Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,u
if ((bestPath)&&(_r->sm->send(bestPath->address(),bestPath->tcp(),bestPath->type() == Path::PATH_TYPE_TCP_OUT,data,len))) {
bestPath->sent(now);
- return true;
+ return bestPath->type();
}
- return false;
+ return Path::PATH_TYPE_NULL;
}
bool Peer::sendFirewallOpener(const RuntimeEnvironment *_r,uint64_t now)