aboutsummaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-11-18 19:19:41 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-11-18 19:19:41 +0000
commitc5c7911dab8732861affbe66849a100da62f7464 (patch)
treebfbb16bc8fbcb4911a24a5e32f9f4c3c280f392c /util.cpp
parentb349e3dca89dfff5fe70669f9fd3f3a1ec60a498 (diff)
downloadbitcoin-c5c7911dab8732861affbe66849a100da62f7464.tar.xz
bugfix Db::open/close and zombie sockets bugs fix double-close of socket handle,
keep databases open, close db cursors, initial block download in batches of 500 blocks, fix misc warnings, subver linux-test8 git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@40 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'util.cpp')
-rw-r--r--util.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/util.cpp b/util.cpp
index 7a947730ce..305db5ceeb 100644
--- a/util.cpp
+++ b/util.cpp
@@ -56,9 +56,11 @@ public:
// Close sockets
foreach(CNode* pnode, vNodes)
- closesocket(pnode->hSocket);
- if (closesocket(hListenSocket) == SOCKET_ERROR)
- printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
+ if (pnode->hSocket != INVALID_SOCKET)
+ closesocket(pnode->hSocket);
+ if (hListenSocket != INVALID_SOCKET)
+ if (closesocket(hListenSocket) == SOCKET_ERROR)
+ printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
#ifdef __WXMSW__
// Shutdown Windows Sockets
@@ -348,7 +350,7 @@ void ParseParameters(int argc, char* argv[])
{
char psz[10000];
strlcpy(psz, argv[i], sizeof(psz));
- char* pszValue = "";
+ char* pszValue = (char*)"";
if (strchr(psz, '='))
{
pszValue = strchr(psz, '=');