aboutsummaryrefslogtreecommitdiff
path: root/src/irc.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-02-19 19:05:41 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-19 19:06:42 +0100
commita3342d096f3456e5e8d087bb3c8eea8b25eb6b57 (patch)
tree593c21e6c05cd92079831784f436bdf4ca653e70 /src/irc.cpp
parente0b8d459b189ee2b7e95a47b217e4b02bfb523b3 (diff)
Fix #626: RecvLine wrong error message
Also moved RecvLine to net.cpp.
Diffstat (limited to 'src/irc.cpp')
-rw-r--r--src/irc.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/irc.cpp b/src/irc.cpp
index e79577269e..7a6f40cfad 100644
--- a/src/irc.cpp
+++ b/src/irc.cpp
@@ -76,57 +76,6 @@ static bool Send(SOCKET hSocket, const char* pszSend)
return true;
}
-bool RecvLine(SOCKET hSocket, string& strLine)
-{
- strLine = "";
- loop
- {
- 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)
- {
- if (fShutdown)
- return false;
- if (nBytes < 0)
- {
- int nErr = WSAGetLastError();
- if (nErr == WSAEMSGSIZE)
- continue;
- if (nErr == WSAEWOULDBLOCK || nErr == WSAEINTR || nErr == WSAEINPROGRESS)
- {
- Sleep(10);
- continue;
- }
- }
- if (!strLine.empty())
- return true;
- if (nBytes == 0)
- {
- // socket closed
- printf("IRC socket closed\n");
- return false;
- }
- else
- {
- // socket error
- int nErr = WSAGetLastError();
- printf("IRC recv failed: %d\n", nErr);
- return false;
- }
- }
- }
-}
-
bool RecvLineIRC(SOCKET hSocket, string& strLine)
{
loop