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
This commit is contained in:
s_nakamoto
2009-11-18 19:19:41 +00:00
parent b349e3dca8
commit c5c7911dab
23 changed files with 307 additions and 187 deletions

View File

@@ -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, '=');