cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Implementing CURLOPT_INTERFACE on Windows

From: Mike Cherepov <mcherepov_at_cisco.com>
Date: Mon, 11 Aug 2003 17:13:41 -0400

Thanks. Worked as expected on my Win2k box with the MSVC6.0
tools. The trivial diffs follow.
  --Mike Cherepov

diff -c -r1.1 connect.c
*** connect.c 5 Jun 2003 13:24:16 -0000 1.1
--- connect.c 11 Aug 2003 21:04:11 -0000
***************
*** 70,75 ****
--- 70,76 ----
  #define EINPROGRESS WSAEINPROGRESS
  #define EWOULDBLOCK WSAEWOULDBLOCK
  #define EISCONN WSAEISCONN
+ #define ENOTSOCK WSAENOTSOCK
  #endif
  
  #include "urldata.h"
***************
*** 190,200 ****
  static CURLcode bindlocal(struct connectdata *conn,
                            int sockfd)
  {
- #if !defined(WIN32)||defined(__CYGWIN32__)
- /* We don't generally like checking for OS-versions, we should make
this
- HAVE_XXXX based, although at the moment I don't have a decent
test for
- this! */
-
  #ifdef HAVE_INET_NTOA
  
    struct SessionHandle *data = conn->data;
--- 191,196 ----
***************
*** 335,341 ****
  
    } /* end of device selection support */
  #endif /* end of HAVE_INET_NTOA */
- #endif /* end of not WIN32 */
  
    return CURLE_HTTP_PORT_FAILED;
  }
--- 331,336 ----

> -----Original Message-----
> From: curl-library-admin_at_lists.sourceforge.net
> [mailto:curl-library-admin_at_lists.sourceforge.net] On Behalf
> Of Daniel Stenberg
> Sent: Thursday, August 07, 2003 2:19 PM
> To: libcurl Mailing list
> Subject: Re: Implementing CURLOPT_INTERFACE on Windows
>
>
> On Thu, 7 Aug 2003, Mike Cherepov wrote:
>
> > Trying to bind to a particular local IP with CURLOPT_INTERFACE on a
> > Win2k box I get CURLE_HTTP_PORT_FAILED upon connect. No
> mistake there:
> > bindlocal() works only for
> > #if !defined(WIN32)||defined(__CYGWIN32__).
>
> Right. I personally have no clue on why this doesn't work on
> windows or what it takes to make it work.
>
> > I'd like to do it. Any clues on the extent and nature of Windows'
> > disability in specifying a local port? Any comments on effort to
> > implement this, workarounds, and such?
>
> I would suggest that you remove the #ifdef and try compiling
> it. Then you take one problem at a time and fix them. The
> Curl_if2ip() part (that converts from a unix network
> interface name to IP adress) can probably be left as it is
> today: not working on windows.
>
> --
> Daniel Stenberg -- curl: been grokking URLs since 1998
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites
> including Data Reports, E-commerce, Portals, and Forums are
> available now. Download today and enter to win an XBOX or
> Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet
_072303_01/01

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-11