cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl 7.10.5 and winsock

From: Serge Semashko <ss_at_vba.com.by>
Date: Thu, 25 Sep 2003 17:33:06 +0300

Ben wrote:

> Hello All,
> I'm running an application to fetch downloads from a web server and I
> need to be able to run it on Windows 95. When I try to run there I get
> warnings about missing dll's for Winsock 2. Is there a way to get
> libcurl to work with previous versions of Winsock or am I locked with
> Winsock 2. Any help on this would be greatly appreciated.
>
>
>
>
> ------------------------------------------------------------------------

Yes, it is quite simple to build libcurl with the previous version of
Winsock, at least it works for me well.
You just need to patch easy.c file (the patch is attached) to disable
Winsock 2 version check, and disable one of the protocols which requires
Winsock 2 (using CURL_DISABLE_* define), I do not remember which one
exactly, but you will get unresolved externels from the object file
related to this protocol when linking, so you can find it yourself. Do
not forget to replace ws2_32.lib import library with wsock32.lib in the
project file too.

diff -u -r C:\13\curl-7.10.3\lib/easy.c C:\13\curl-7.10.3.new\lib/easy.c
--- C:\13\curl-7.10.3\lib/easy.c Wed Jan 8 17:05:52 2003
+++ C:\13\curl-7.10.3.new\lib/easy.c Wed Jul 30 12:29:04 2003
@@ -95,7 +95,7 @@
   WORD wVersionRequested;
   WSADATA wsaData;
   int err;
- wVersionRequested = MAKEWORD(2, 0);
+ wVersionRequested = MAKEWORD(1, 1);
     
   err = WSAStartup(wVersionRequested, &wsaData);
     
@@ -104,20 +104,6 @@
     /* winsock.dll. */
     return CURLE_FAILED_INIT;
     
- /* Confirm that the Windows Sockets DLL supports 2.0.*/
- /* Note that if the DLL supports versions greater */
- /* than 2.0 in addition to 2.0, it will still return */
- /* 2.0 in wVersion since that is the version we */
- /* requested. */
-
- if ( LOBYTE( wsaData.wVersion ) != 2 ||
- HIBYTE( wsaData.wVersion ) != 0 ) {
- /* Tell the user that we couldn't find a useable */
-
- /* winsock.dll. */
- WSACleanup();
- return CURLE_FAILED_INIT;
- }
   return CURLE_OK;
 }
 /* The Windows Sockets DLL is acceptable. Proceed. */

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-25