[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 75/411: win32: drop support for WinSock version 1, require versi
From: |
gnunet |
Subject: |
[gnurl] 75/411: win32: drop support for WinSock version 1, require version 2 |
Date: |
Wed, 13 Jan 2021 01:18:10 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 3e4b32a3e1250d49bd0e45a35b3a08a2f4d07d8f
Author: Marc Hoersken <info@marc-hoersken.de>
AuthorDate: Sun Aug 30 12:21:53 2020 +0200
win32: drop support for WinSock version 1, require version 2
IPv6, telnet and now also the multi API require WinSock
version 2 which is available starting with Windows 95.
Therefore we think it is time to drop support for version 1.
Reviewed-by: Marcel Raad
Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Reviewed-by: Viktor Szakats
Follow up to #5634
Closes #5854
---
docs/INTERNALS.md | 3 +++
lib/curl_setup.h | 10 +---------
lib/setup-win32.h | 3 +--
lib/system_win32.c | 11 +++--------
tests/server/util.c | 6 +++---
5 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md
index 635e7b2d1..a15703463 100644
--- a/docs/INTERNALS.md
+++ b/docs/INTERNALS.md
@@ -97,6 +97,7 @@ Dependencies
- NSS 3.14.x
- Heimdal ?
- nghttp2 1.12.0
+ - WinSock 2.2 (on Windows 95+ and Windows CE .NET 4.1+)
Operating Systems
-----------------
@@ -146,6 +147,8 @@ Windows vs Unix
also do it etc there might be reasons for applications to alter that
behaviour.
+ We require WinSock version 2.2 and load this version during global init.
+
3. The file descriptors for network communication and file operations are
not as easily interchangeable as in Unix.
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 9b845c8d8..276caaa26 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -559,14 +559,6 @@
/* ---------------------------------------------------------------- */
-/*
- * When using WINSOCK, TELNET protocol requires WINSOCK2 API.
- */
-
-#if defined(USE_WINSOCK) && (USE_WINSOCK != 2)
-# define CURL_DISABLE_TELNET 1
-#endif
-
/*
* msvc 6.0 does not have struct sockaddr_storage and
* does not define IPPROTO_ESP in winsock2.h. But both
@@ -705,7 +697,7 @@ int netware_init(void);
defined(HAVE_WINSOCK_H) || \
defined(HAVE_WINSOCK2_H) || \
defined(HAVE_WS2TCPIP_H)
-# error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"
+# error "WinSock and lwIP TCP/IP stack definitions shall not coexist!"
# endif
#endif
diff --git a/lib/setup-win32.h b/lib/setup-win32.h
index 45b584766..d20662aa1 100644
--- a/lib/setup-win32.h
+++ b/lib/setup-win32.h
@@ -60,7 +60,6 @@
/*
* Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
- * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
* undefine USE_WINSOCK.
*/
@@ -70,7 +69,7 @@
# define USE_WINSOCK 2
#else
# ifdef HAVE_WINSOCK_H
-# define USE_WINSOCK 1
+# error "WinSock version 1 is no longer supported, version 2 is required!"
# endif
#endif
diff --git a/lib/system_win32.c b/lib/system_win32.c
index 2e59e032e..9b0797bf9 100644
--- a/lib/system_win32.c
+++ b/lib/system_win32.c
@@ -55,12 +55,7 @@ CURLcode Curl_win32_init(long flags)
WSADATA wsaData;
int res;
-#if defined(ENABLE_IPV6) && (USE_WINSOCK < 2)
-#error IPV6_requires_winsock2
-#endif
-
- wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK);
-
+ wVersionRequested = MAKEWORD(2, 2);
res = WSAStartup(wVersionRequested, &wsaData);
if(res != 0)
@@ -83,9 +78,9 @@ CURLcode Curl_win32_init(long flags)
return CURLE_FAILED_INIT;
}
/* The Windows Sockets DLL is acceptable. Proceed. */
- #elif defined(USE_LWIPSOCK)
+#elif defined(USE_LWIPSOCK)
lwip_init();
- #endif
+#endif
} /* CURL_GLOBAL_WIN32 */
#ifdef USE_WINDOWS_SSPI
diff --git a/tests/server/util.c b/tests/server/util.c
index dccce596b..e95d574f9 100644
--- a/tests/server/util.c
+++ b/tests/server/util.c
@@ -167,8 +167,8 @@ void win32_init(void)
WORD wVersionRequested;
WSADATA wsaData;
int err;
- wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK);
+ wVersionRequested = MAKEWORD(2, 2);
err = WSAStartup(wVersionRequested, &wsaData);
if(err != 0) {
@@ -177,8 +177,8 @@ void win32_init(void)
exit(1);
}
- if(LOBYTE(wsaData.wVersion) != USE_WINSOCK ||
- HIBYTE(wsaData.wVersion) != USE_WINSOCK) {
+ if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) ||
+ HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) {
WSACleanup();
perror("Winsock init failed");
logmsg("No suitable winsock.dll found -- aborting");
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 91/411: connect.c: remove superfluous 'else' in Curl_getconnectinfo, (continued)
- [gnurl] 91/411: connect.c: remove superfluous 'else' in Curl_getconnectinfo, gnunet, 2021/01/12
- [gnurl] 101/411: curl: retry delays in parallel mode no longer sleeps blocking, gnunet, 2021/01/12
- [gnurl] 106/411: tests/libtests: remove test 1900 and 2033, gnunet, 2021/01/12
- [gnurl] 82/411: wildcard: strip "curl_" prefix from private symbols, gnunet, 2021/01/12
- [gnurl] 73/411: CI/azure: MQTT is now enabled by default, gnunet, 2021/01/12
- [gnurl] 107/411: libtest: remove lib1541 leftovers, gnunet, 2021/01/12
- [gnurl] 99/411: build: drop support for building with Watcom, gnunet, 2021/01/12
- [gnurl] 108/411: cmake: make HTTP_ONLY also disable MQTT, gnunet, 2021/01/12
- [gnurl] 100/411: curl:parallel_transfers: make sure retry readds the transfer, gnunet, 2021/01/12
- [gnurl] 95/411: tests: Add tests for new --help, gnunet, 2021/01/12
- [gnurl] 75/411: win32: drop support for WinSock version 1, require version 2,
gnunet <=
- [gnurl] 92/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 116/411: libtest: fix build errors, gnunet, 2021/01/12
- [gnurl] 109/411: FAQ: refreshed some very old language, gnunet, 2021/01/12
- [gnurl] 90/411: CMake: remove explicit `CMAKE_ANSI_CFLAGS`, gnunet, 2021/01/12
- [gnurl] 76/411: telnet.c: depend on static requirement of WinSock version 2, gnunet, 2021/01/12
- [gnurl] 97/411: curl: in retry output don't call all problems "transient", gnunet, 2021/01/12
- [gnurl] 79/411: schannel: make it 'struct Curl_schannel*', gnunet, 2021/01/12
- [gnurl] 88/411: scripts/delta: add diffstat summary, gnunet, 2021/01/12
- [gnurl] 117/411: lib583: fix enum mixup, gnunet, 2021/01/12
- [gnurl] 114/411: RELEASE-NOTES: synced, gnunet, 2021/01/12