summaryrefslogtreecommitdiff
path: root/node/TcpSocket.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-27 17:02:52 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-27 17:02:52 -0700
commitc231510f8b813eb73750f266dd18e836bc02d9cc (patch)
tree357db3b9f7a0fdf52fe739d1daf15b7ebbe3c307 /node/TcpSocket.cpp
parent2ac56fd120c3c9dd924fccc169beed2d51658ba9 (diff)
downloadinfinitytier-c231510f8b813eb73750f266dd18e836bc02d9cc.tar.gz
infinitytier-c231510f8b813eb73750f266dd18e836bc02d9cc.zip
More TCP-related fixes and tweaks to ping timing, resynchronize, and startup.
Diffstat (limited to 'node/TcpSocket.cpp')
-rw-r--r--node/TcpSocket.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/node/TcpSocket.cpp b/node/TcpSocket.cpp
index b56775d8..5d475c93 100644
--- a/node/TcpSocket.cpp
+++ b/node/TcpSocket.cpp
@@ -73,7 +73,7 @@ bool TcpSocket::send(const InetAddress &to,const void *msg,unsigned int msglen)
Mutex::Lock _l(_writeLock);
- bool outputWasEnqueued = (_outptr != 0);
+ bool writeInProgress = ((_outptr != 0)||(_connecting));
// Ensure that _outbuf is large enough
unsigned int newptr = _outptr + 5 + msglen;
@@ -102,7 +102,7 @@ bool TcpSocket::send(const InetAddress &to,const void *msg,unsigned int msglen)
for(unsigned int i=0;i<msglen;++i)
_outbuf[_outptr++] = ((const unsigned char *)msg)[i];
- if (!outputWasEnqueued) {
+ if (!writeInProgress) {
// If no output was enqueued before this, try to send() it and then
// start a queued write if any remains after that.