- bug fixes to stabilize the windows build

This commit is contained in:
Mark Vejvoda
2013-02-09 06:57:05 +00:00
parent f06f86904c
commit 9bc6d33f1d
15 changed files with 82 additions and 42 deletions

View File

@@ -77,7 +77,7 @@ static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
removeFile(fullFilePath);
return -1;
return 0;
}
if(out && out->stream == NULL) {
@@ -94,7 +94,7 @@ static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("===> FTP Client thread FAILED to open file for writing [%s]\n",fullFilePath.c_str());
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"===> FTP Client thread FAILED to open file for writing [%s]\n",fullFilePath.c_str());
SystemFlags::OutputDebug(SystemFlags::debugError,"===> FTP Client thread FAILED to open file for writing [%s]\n",fullFilePath.c_str());
return -1; /* failure, can't open file to write */
return 0; /* failure, can't open file to write */
}
out->isValidXfer = true;
@@ -103,7 +103,7 @@ static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("===> #2 FTP Client thread FAILED to open file for writing [%s]\n",fullFilePath.c_str());
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"===> #2 FTP Client thread FAILED to open file for writing [%s]\n",fullFilePath.c_str());
SystemFlags::OutputDebug(SystemFlags::debugError,"===> #2 FTP Client thread FAILED to open file for writing [%s]\n",fullFilePath.c_str());
return -1; /* failure, can't open file to write */
return 0; /* failure, can't open file to write */
}
size_t result = fwrite(buffer, size, nmemb, out->stream);

View File

@@ -963,7 +963,7 @@ void Socket::disconnectSocket() {
sock = INVALID_SOCKET;
#else
::closesocket(sock);
sock = -1;
sock = INVALID_SOCKET;
#endif
}
safeMutex.ReleaseLock();
@@ -2036,7 +2036,7 @@ void BroadCastClientSocketThread::execute() {
bcfd = INVALID_SOCKET;
#else
::closesocket(bcfd);
bcfd = -1;
bcfd = INVALID_SOCKET;
#endif
}
@@ -2331,7 +2331,7 @@ Socket *ServerSocket::accept(bool errorOnFail) {
newSock = INVALID_SOCKET;
#else
::closesocket(newSock);
newSock = -1;
newSock = INVALID_SOCKET;
#endif
return NULL;
@@ -2773,7 +2773,7 @@ void BroadCastSocketThread::execute() {
#ifdef WIN32
bcfd[idx] = INVALID_SOCKET;
#else
bcfd[idx] = -1;
bcfd[idx] = INVALID_SOCKET;
#endif
//if(strlen(subnetmask[idx]) > 0) {
bcfd[idx] = socket( AF_INET, SOCK_DGRAM, 0 );
@@ -2867,7 +2867,7 @@ void BroadCastSocketThread::execute() {
bcfd[idx] = INVALID_SOCKET;
#else
::closesocket(bcfd[idx]);
bcfd[idx] = -1;
bcfd[idx] = INVALID_SOCKET;
#endif
}
}