aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-20 18:02:45 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-20 18:03:20 +0100
commit66b473457bc94adcd3d277462f9d619f5a198d96 (patch)
treecc62e927be208e2f764c41c06f620b249aec52a5
parent7810a0a1e6fc4088694a45b5c86493a47d5c7c8a (diff)
downloadbitcoin-66b473457bc94adcd3d277462f9d619f5a198d96.tar.xz
Delete RecvLine function
No longer necessary since #5161 / 845c86d128fb97d55d125e63653def38729bd2ed.
-rw-r--r--src/net.cpp50
-rw-r--r--src/net.h1
2 files changed, 0 insertions, 51 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 8cf2d0ffec..bba80535e5 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -157,56 +157,6 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer)
return ret;
}
-bool RecvLine(SOCKET hSocket, string& strLine)
-{
- strLine = "";
- while (true)
- {
- char c;
- int nBytes = recv(hSocket, &c, 1, 0);
- if (nBytes > 0)
- {
- if (c == '\n')
- continue;
- if (c == '\r')
- return true;
- strLine += c;
- if (strLine.size() >= 9000)
- return true;
- }
- else if (nBytes <= 0)
- {
- boost::this_thread::interruption_point();
- if (nBytes < 0)
- {
- int nErr = WSAGetLastError();
- if (nErr == WSAEMSGSIZE)
- continue;
- if (nErr == WSAEWOULDBLOCK || nErr == WSAEINTR || nErr == WSAEINPROGRESS)
- {
- MilliSleep(10);
- continue;
- }
- }
- if (!strLine.empty())
- return true;
- if (nBytes == 0)
- {
- // socket closed
- LogPrint("net", "socket closed\n");
- return false;
- }
- else
- {
- // socket error
- int nErr = WSAGetLastError();
- LogPrint("net", "recv failed: %s\n", NetworkErrorString(nErr));
- return false;
- }
- }
- }
-}
-
int GetnScore(const CService& addr)
{
LOCK(cs_mapLocalHost);
diff --git a/src/net.h b/src/net.h
index bdb1edd50b..b78665b5c6 100644
--- a/src/net.h
+++ b/src/net.h
@@ -61,7 +61,6 @@ unsigned int ReceiveFloodSize();
unsigned int SendBufferSize();
void AddOneShot(std::string strDest);
-bool RecvLine(SOCKET hSocket, std::string& strLine);
void AddressCurrentlyConnected(const CService& addr);
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const std::string& addrName);