summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-10 15:55:48 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-09-10 15:55:48 -0700
commit9dc2ef554997f5598c9cf2c4d3ca041c3152a962 (patch)
treefdbecbda24778b7e63ff344986cda6fb47738b46
parentcd3d77987ccaa77df803332a2ab0ff4805fabf70 (diff)
downloadinfinitytier-9dc2ef554997f5598c9cf2c4d3ca041c3152a962.tar.gz
infinitytier-9dc2ef554997f5598c9cf2c4d3ca041c3152a962.zip
Rename some stuff in Phy since it can be used with any stream socket.
-rw-r--r--selftest.cpp4
-rw-r--r--service/OneService.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/selftest.cpp b/selftest.cpp
index a664ca8e..b899ee5a 100644
--- a/selftest.cpp
+++ b/selftest.cpp
@@ -795,7 +795,7 @@ struct TestPhyHandlers
{
++phyTestTcpAcceptCount;
*uptrN = new std::string(ZT_TEST_PHY_TCP_MESSAGE_SIZE,(char)0xff);
- testPhyInstance->tcpSetNotifyWritable(sockN,true);
+ testPhyInstance->setNotifyWritable(sockN,true);
}
inline void phyOnTcpClose(PhySocket *sock,void **uptr)
@@ -812,7 +812,7 @@ struct TestPhyHandlers
{
std::string *testMessage = (std::string *)*uptr;
if ((testMessage)&&(testMessage->length() > 0)) {
- long sent = testPhyInstance->tcpSend(sock,(const void *)testMessage->data(),(unsigned long)testMessage->length(),true);
+ long sent = testPhyInstance->streamSend(sock,(const void *)testMessage->data(),(unsigned long)testMessage->length(),true);
if (sent > 0)
testMessage->erase(0,sent);
}
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 8085c9b4..e8b8ba60 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -772,7 +772,7 @@ public:
tc->writeBuf.push_back((char)ZEROTIER_ONE_VERSION_MINOR);
tc->writeBuf.push_back((char)((ZEROTIER_ONE_VERSION_REVISION >> 8) & 0xff));
tc->writeBuf.push_back((char)(ZEROTIER_ONE_VERSION_REVISION & 0xff));
- _phy.tcpSetNotifyWritable(sock,true);
+ _phy.setNotifyWritable(sock,true);
_tcpFallbackTunnel = tc;
}
@@ -907,12 +907,12 @@ public:
TcpConnection *tc = reinterpret_cast<TcpConnection *>(*uptr);
Mutex::Lock _l(tc->writeBuf_m);
if (tc->writeBuf.length() > 0) {
- long sent = (long)_phy.tcpSend(sock,tc->writeBuf.data(),(unsigned long)tc->writeBuf.length(),true);
+ long sent = (long)_phy.streamSend(sock,tc->writeBuf.data(),(unsigned long)tc->writeBuf.length(),true);
if (sent > 0) {
tc->lastActivity = OSUtils::now();
if ((unsigned long)sent >= (unsigned long)tc->writeBuf.length()) {
tc->writeBuf = "";
- _phy.tcpSetNotifyWritable(sock,false);
+ _phy.setNotifyWritable(sock,false);
if (!tc->shouldKeepAlive)
_phy.close(sock); // will call close handler to delete from _tcpConnections
} else {
@@ -920,7 +920,7 @@ public:
}
}
} else {
- _phy.tcpSetNotifyWritable(sock,false);
+ _phy.setNotifyWritable(sock,false);
}
}
@@ -1111,7 +1111,7 @@ public:
if (_tcpFallbackTunnel) {
Mutex::Lock _l(_tcpFallbackTunnel->writeBuf_m);
if (!_tcpFallbackTunnel->writeBuf.length())
- _phy.tcpSetNotifyWritable(_tcpFallbackTunnel->sock,true);
+ _phy.setNotifyWritable(_tcpFallbackTunnel->sock,true);
unsigned long mlen = len + 7;
_tcpFallbackTunnel->writeBuf.push_back((char)0x17);
_tcpFallbackTunnel->writeBuf.push_back((char)0x03);
@@ -1214,7 +1214,7 @@ public:
tc->writeBuf.append(data);
}
- _phy.tcpSetNotifyWritable(tc->sock,true);
+ _phy.setNotifyWritable(tc->sock,true);
}
inline void onHttpResponseFromClient(TcpConnection *tc)