diff options
| author | Gavin Andresen <[email protected]> | 2012-02-22 10:52:14 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2012-02-22 10:52:14 -0500 |
| commit | de737806b502dc86275d03f4aed7a83dcad67cce (patch) | |
| tree | 84327e3875f8fef7d6ae3716843e3f3fe5dd8e11 /src/irc.cpp | |
| parent | Merge branch 'bugfix_bip14_ez' of https://github.com/luke-jr/bitcoin (diff) | |
| parent | Fix #626: RecvLine wrong error message (diff) | |
| download | discoin-de737806b502dc86275d03f4aed7a83dcad67cce.tar.xz discoin-de737806b502dc86275d03f4aed7a83dcad67cce.zip | |
Merge branch 'fix_626' of https://github.com/sipa/bitcoin
Diffstat (limited to 'src/irc.cpp')
| -rw-r--r-- | src/irc.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/irc.cpp b/src/irc.cpp index e79577269..7a6f40cfa 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 |