aboutsummaryrefslogtreecommitdiff
path: root/irc.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-09-07 01:12:53 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-09-07 01:12:53 +0000
commitf1e1fb4bdef878c8fc1564fa418d44e7541a7e83 (patch)
tree1f3dcb611059e60f2faa5d75d72186aacfff18df /irc.cpp
parentd743f0355269e2e03fe3f982e250d07999d72b98 (diff)
downloadbitcoin-f1e1fb4bdef878c8fc1564fa418d44e7541a7e83.tar.xz
cleanup,
catch some recoverable exceptions and continue git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@148 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'irc.cpp')
-rw-r--r--irc.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/irc.cpp b/irc.cpp
index daa9a0db61..a520173f1b 100644
--- a/irc.cpp
+++ b/irc.cpp
@@ -6,6 +6,9 @@
int nGotIRCAddresses = 0;
+void ThreadIRCSeed2(void* parg);
+
+
#pragma pack(push, 1)
@@ -128,6 +131,7 @@ int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const cha
loop
{
string strLine;
+ strLine.reserve(10000);
if (!RecvLineIRC(hSocket, strLine))
return 0;
printf("IRC %s\n", strLine.c_str());
@@ -158,6 +162,21 @@ bool Wait(int nSeconds)
void ThreadIRCSeed(void* parg)
{
+ IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg));
+ try
+ {
+ ThreadIRCSeed2(parg);
+ }
+ catch (std::exception& e) {
+ PrintExceptionContinue(&e, "ThreadIRCSeed()");
+ } catch (...) {
+ PrintExceptionContinue(NULL, "ThreadIRCSeed()");
+ }
+ printf("ThreadIRCSeed exiting\n");
+}
+
+void ThreadIRCSeed2(void* parg)
+{
if (mapArgs.count("-connect"))
return;
if (mapArgs.count("-noirc"))
@@ -236,6 +255,7 @@ void ThreadIRCSeed(void* parg)
int64 nStart = GetTime();
string strLine;
+ strLine.reserve(10000);
while (!fShutdown && RecvLineIRC(hSocket, strLine))
{
if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':')