Use Windows sockets when building Wininet on Mingw.
This commit is contained in:
parent
925d3c26aa
commit
c91ae456b8
|
@ -311,7 +311,7 @@ ac_includes_default="\
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif"
|
#endif"
|
||||||
|
|
||||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS WIN16_FILES WIN16_INSTALL build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS DB2HTML DB2PDF DB2PS DB2TXT FONTFORGE LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS ft_devel ft_devel2 FREETYPELIBS FREETYPEINCL FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS CAPI4LINUXLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS WINE_BINARIES MAIN_BINARY LDD ALLOCA LIBOBJS LTLIBOBJS'
|
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS WIN16_FILES WIN16_INSTALL build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS DB2HTML DB2PDF DB2PS DB2TXT FONTFORGE LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS ft_devel ft_devel2 FREETYPELIBS FREETYPEINCL FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS CAPI4LINUXLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD ALLOCA LIBOBJS LTLIBOBJS'
|
||||||
ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES'
|
ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES'
|
||||||
|
|
||||||
# Initialize some variables set by options.
|
# Initialize some variables set by options.
|
||||||
|
@ -14217,6 +14217,9 @@ esac
|
||||||
case $host_os in
|
case $host_os in
|
||||||
mingw32*)
|
mingw32*)
|
||||||
CRTLIBS="-lmsvcrt"
|
CRTLIBS="-lmsvcrt"
|
||||||
|
|
||||||
|
SOCKETLIBS="-lws2_32"
|
||||||
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -20998,6 +21001,7 @@ s,@CROSSCC@,$CROSSCC,;t t
|
||||||
s,@CROSSWINDRES@,$CROSSWINDRES,;t t
|
s,@CROSSWINDRES@,$CROSSWINDRES,;t t
|
||||||
s,@LDPATH@,$LDPATH,;t t
|
s,@LDPATH@,$LDPATH,;t t
|
||||||
s,@CRTLIBS@,$CRTLIBS,;t t
|
s,@CRTLIBS@,$CRTLIBS,;t t
|
||||||
|
s,@SOCKETLIBS@,$SOCKETLIBS,;t t
|
||||||
s,@WINE_BINARIES@,$WINE_BINARIES,;t t
|
s,@WINE_BINARIES@,$WINE_BINARIES,;t t
|
||||||
s,@MAIN_BINARY@,$MAIN_BINARY,;t t
|
s,@MAIN_BINARY@,$MAIN_BINARY,;t t
|
||||||
s,@LDD@,$LDD,;t t
|
s,@LDD@,$LDD,;t t
|
||||||
|
|
|
@ -984,10 +984,12 @@ case $build_os in
|
||||||
AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
|
AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
dnl Mingw needs explicit msvcrt for linking libwine
|
dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
|
||||||
case $host_os in
|
case $host_os in
|
||||||
mingw32*)
|
mingw32*)
|
||||||
AC_SUBST(CRTLIBS,"-lmsvcrt") ;;
|
AC_SUBST(CRTLIBS,"-lmsvcrt")
|
||||||
|
AC_SUBST(SOCKETLIBS,"-lws2_32")
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = wininet.dll
|
MODULE = wininet.dll
|
||||||
IMPORTS = mpr shlwapi shell32 user32 advapi32 kernel32 ntdll
|
IMPORTS = mpr shlwapi shell32 user32 advapi32 kernel32 ntdll
|
||||||
EXTRALIBS = $(LIBUNICODE)
|
EXTRALIBS = $(LIBUNICODE) @SOCKETLIBS@
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
cookie.c \
|
cookie.c \
|
||||||
|
|
|
@ -272,7 +272,7 @@ BOOL WINAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
|
||||||
if (FTP_GetDataSocket(lpwfs, &nDataSocket))
|
if (FTP_GetDataSocket(lpwfs, &nDataSocket))
|
||||||
{
|
{
|
||||||
FTP_SendData(lpwfs, nDataSocket, hFile);
|
FTP_SendData(lpwfs, nDataSocket, hFile);
|
||||||
close(nDataSocket);
|
closesocket(nDataSocket);
|
||||||
nResCode = FTP_ReceiveResponse(lpwfs, dwContext);
|
nResCode = FTP_ReceiveResponse(lpwfs, dwContext);
|
||||||
if (nResCode)
|
if (nResCode)
|
||||||
{
|
{
|
||||||
|
@ -286,7 +286,7 @@ BOOL WINAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
|
||||||
|
|
||||||
lend:
|
lend:
|
||||||
if (lpwfs->lstnSocket != -1)
|
if (lpwfs->lstnSocket != -1)
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
|
|
||||||
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
|
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
|
||||||
{
|
{
|
||||||
|
@ -691,7 +691,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
|
||||||
if (FTP_GetDataSocket(lpwfs, &nDataSocket))
|
if (FTP_GetDataSocket(lpwfs, &nDataSocket))
|
||||||
{
|
{
|
||||||
hFindNext = FTP_ReceiveFileList(lpwfs, nDataSocket, lpszSearchFile, lpFindFileData, dwContext);
|
hFindNext = FTP_ReceiveFileList(lpwfs, nDataSocket, lpszSearchFile, lpFindFileData, dwContext);
|
||||||
close(nDataSocket);
|
closesocket(nDataSocket);
|
||||||
nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext);
|
nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext);
|
||||||
if (nResCode != 226 && nResCode != 250)
|
if (nResCode != 226 && nResCode != 250)
|
||||||
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
|
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
|
||||||
|
@ -703,7 +703,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
|
||||||
|
|
||||||
lend:
|
lend:
|
||||||
if (lpwfs->lstnSocket != -1)
|
if (lpwfs->lstnSocket != -1)
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
|
|
||||||
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
|
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
|
||||||
{
|
{
|
||||||
|
@ -1034,7 +1034,7 @@ HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpwfs->lstnSocket != -1)
|
if (lpwfs->lstnSocket != -1)
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
|
|
||||||
hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
|
hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
|
||||||
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
|
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
|
||||||
|
@ -1207,13 +1207,13 @@ BOOL WINAPI FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile,
|
||||||
else
|
else
|
||||||
FTP_SetResponseError(nResCode);
|
FTP_SetResponseError(nResCode);
|
||||||
}
|
}
|
||||||
close(nDataSocket);
|
closesocket(nDataSocket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lend:
|
lend:
|
||||||
if (lpwfs->lstnSocket != -1)
|
if (lpwfs->lstnSocket != -1)
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
|
|
||||||
if (hFile)
|
if (hFile)
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
|
@ -1741,7 +1741,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
|
||||||
|
|
||||||
lerror:
|
lerror:
|
||||||
if (!bSuccess && nsocket == -1)
|
if (!bSuccess && nsocket == -1)
|
||||||
close(nsocket);
|
closesocket(nsocket);
|
||||||
|
|
||||||
if (!bSuccess && lpwfs)
|
if (!bSuccess && lpwfs)
|
||||||
{
|
{
|
||||||
|
@ -2066,7 +2066,7 @@ BOOL FTP_SendStore(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD dwT
|
||||||
lend:
|
lend:
|
||||||
if (!bSuccess && lpwfs->lstnSocket != -1)
|
if (!bSuccess && lpwfs->lstnSocket != -1)
|
||||||
{
|
{
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
lpwfs->lstnSocket = -1;
|
lpwfs->lstnSocket = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2122,7 +2122,7 @@ BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs)
|
||||||
lend:
|
lend:
|
||||||
if (!bSuccess && lpwfs->lstnSocket == -1)
|
if (!bSuccess && lpwfs->lstnSocket == -1)
|
||||||
{
|
{
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
lpwfs->lstnSocket = -1;
|
lpwfs->lstnSocket = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2386,7 +2386,7 @@ BOOL FTP_GetDataSocket(LPWININETFTPSESSIONW lpwfs, LPINT nDataSocket)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*nDataSocket = accept(lpwfs->lstnSocket, (struct sockaddr *) &saddr, &addrlen);
|
*nDataSocket = accept(lpwfs->lstnSocket, (struct sockaddr *) &saddr, &addrlen);
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
lpwfs->lstnSocket = -1;
|
lpwfs->lstnSocket = -1;
|
||||||
}
|
}
|
||||||
return *nDataSocket != -1;
|
return *nDataSocket != -1;
|
||||||
|
@ -2518,7 +2518,7 @@ DWORD FTP_SendRetrieve(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD
|
||||||
lend:
|
lend:
|
||||||
if (0 == nResult && lpwfs->lstnSocket != -1)
|
if (0 == nResult && lpwfs->lstnSocket != -1)
|
||||||
{
|
{
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
lpwfs->lstnSocket = -1;
|
lpwfs->lstnSocket = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2600,10 +2600,10 @@ static void FTP_CloseSessionHandle(LPWININETHANDLEHEADER hdr)
|
||||||
lpwfs->download_in_progress->session_deleted = TRUE;
|
lpwfs->download_in_progress->session_deleted = TRUE;
|
||||||
|
|
||||||
if (lpwfs->sndSocket != -1)
|
if (lpwfs->sndSocket != -1)
|
||||||
close(lpwfs->sndSocket);
|
closesocket(lpwfs->sndSocket);
|
||||||
|
|
||||||
if (lpwfs->lstnSocket != -1)
|
if (lpwfs->lstnSocket != -1)
|
||||||
close(lpwfs->lstnSocket);
|
closesocket(lpwfs->lstnSocket);
|
||||||
|
|
||||||
if (lpwfs->lpszPassword)
|
if (lpwfs->lpszPassword)
|
||||||
HeapFree(GetProcessHeap(), 0, lpwfs->lpszPassword);
|
HeapFree(GetProcessHeap(), 0, lpwfs->lpszPassword);
|
||||||
|
@ -2668,7 +2668,7 @@ static void FTP_CloseFileTransferHandle(LPWININETHANDLEHEADER hdr)
|
||||||
nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext);
|
nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext);
|
||||||
|
|
||||||
if (lpwh->nDataSocket != -1)
|
if (lpwh->nDataSocket != -1)
|
||||||
close(lpwh->nDataSocket);
|
closesocket(lpwh->nDataSocket);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpwh);
|
HeapFree(GetProcessHeap(), 0, lpwh);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,12 @@
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#include "winsock2.h"
|
||||||
|
#else
|
||||||
|
#define closesocket close
|
||||||
|
#endif /* __MINGW32__ */
|
||||||
|
|
||||||
/* used for netconnection.c stuff */
|
/* used for netconnection.c stuff */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -228,7 +228,7 @@ BOOL NETCON_close(WININET_NETCONNECTION *connection)
|
||||||
if (!connection->useSSL)
|
if (!connection->useSSL)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
result = close(connection->socketFD);
|
result = closesocket(connection->socketFD);
|
||||||
connection->socketFD = -1;
|
connection->socketFD = -1;
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -237,7 +237,7 @@ BOOL NETCON_close(WININET_NETCONNECTION *connection)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OPENSSL_SSL_H
|
#ifdef HAVE_OPENSSL_SSL_H
|
||||||
close(connection->ssl_sock);
|
closesocket(connection->ssl_sock);
|
||||||
connection->ssl_sock = -1;
|
connection->ssl_sock = -1;
|
||||||
/* FIXME should we call SSL_shutdown here?? Probably on whatever is the
|
/* FIXME should we call SSL_shutdown here?? Probably on whatever is the
|
||||||
* opposite of NETCON_init.... */
|
* opposite of NETCON_init.... */
|
||||||
|
@ -262,7 +262,7 @@ BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *se
|
||||||
result = connect(connection->socketFD, serv_addr, addrlen);
|
result = connect(connection->socketFD, serv_addr, addrlen);
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
{
|
{
|
||||||
close(connection->socketFD);
|
closesocket(connection->socketFD);
|
||||||
connection->socketFD = -1;
|
connection->socketFD = -1;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -408,11 +408,14 @@ typedef struct WS(fd_set)
|
||||||
# endif
|
# endif
|
||||||
} WS(fd_set), FD_SET, *PFD_SET, *LPFD_SET;
|
} WS(fd_set), FD_SET, *PFD_SET, *LPFD_SET;
|
||||||
|
|
||||||
|
#ifndef _TIMEVAL_DEFINED
|
||||||
|
#define _TIMEVAL_DEFINED
|
||||||
typedef struct WS(timeval)
|
typedef struct WS(timeval)
|
||||||
{
|
{
|
||||||
long tv_sec; /* seconds */
|
long tv_sec; /* seconds */
|
||||||
long tv_usec; /* and microseconds */
|
long tv_usec; /* and microseconds */
|
||||||
} TIMEVAL, *PTIMEVAL, *LPTIMEVAL;
|
} TIMEVAL, *PTIMEVAL, *LPTIMEVAL;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define WINE_FD_CLR(fd, set, cast) do { \
|
#define WINE_FD_CLR(fd, set, cast) do { \
|
||||||
u_int __i; \
|
u_int __i; \
|
||||||
|
|
Loading…
Reference in New Issue