Commit 51a57b7e authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

wininet: Ensure the ftp connections lstnSocket is set to -1 after each close.

parent deb9404b
...@@ -380,7 +380,10 @@ static BOOL FTP_FtpPutFileW(ftp_session_t *lpwfs, LPCWSTR lpszLocalFile, ...@@ -380,7 +380,10 @@ static BOOL FTP_FtpPutFileW(ftp_session_t *lpwfs, LPCWSTR lpszLocalFile,
} }
if (lpwfs->lstnSocket != -1) if (lpwfs->lstnSocket != -1)
{
closesocket(lpwfs->lstnSocket); closesocket(lpwfs->lstnSocket);
lpwfs->lstnSocket = -1;
}
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
...@@ -850,7 +853,10 @@ static HINTERNET FTP_FtpFindFirstFileW(ftp_session_t *lpwfs, ...@@ -850,7 +853,10 @@ static HINTERNET FTP_FtpFindFirstFileW(ftp_session_t *lpwfs,
lend: lend:
if (lpwfs->lstnSocket != -1) if (lpwfs->lstnSocket != -1)
{
closesocket(lpwfs->lstnSocket); closesocket(lpwfs->lstnSocket);
lpwfs->lstnSocket = -1;
}
hIC = lpwfs->lpAppInfo; hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
...@@ -1305,7 +1311,10 @@ HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs, ...@@ -1305,7 +1311,10 @@ HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
} }
if (lpwfs->lstnSocket != -1) if (lpwfs->lstnSocket != -1)
{
closesocket(lpwfs->lstnSocket); closesocket(lpwfs->lstnSocket);
lpwfs->lstnSocket = -1;
}
hIC = lpwfs->lpAppInfo; hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
...@@ -1629,7 +1638,10 @@ static BOOL FTP_FtpGetFileW(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, LPCWST ...@@ -1629,7 +1638,10 @@ static BOOL FTP_FtpGetFileW(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, LPCWST
} }
if (lpwfs->lstnSocket != -1) if (lpwfs->lstnSocket != -1)
{
closesocket(lpwfs->lstnSocket); closesocket(lpwfs->lstnSocket);
lpwfs->lstnSocket = -1;
}
CloseHandle(hFile); CloseHandle(hFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment