cURL / Mailing Lists / curl-library / Single Mail


RE: CURLOPT_LOCALPORT option broken ?!

From: Senthil Raja Velu <>
Date: Fri, 20 Feb 2009 17:10:08 -0800

Nevertheless I tried the fix, but it did not work for me. Here are the

My URL is set to:
    curl_easy_setopt(mp_curl, CURLOPT_LOCALPORTRANGE, 1L);
    curl_easy_setopt(mp_curl, CURLOPT_LOCALPORT,60027L);
    curl_easy_setopt(mp_curl, CURLOPT_INTERFACE, "");

And CURL throws the following error using the trace callback;

CURL: About to connect() to port 443 (#0)
CURL: Trying CURL: Domain is ip
CURL: Couldn't bind to ''
CURL: couldn't connect to host
CURL: Closing connection #0


-----Original Message-----
From: Senthil Raja Velu
Sent: Friday, February 20, 2009 11:39 AM
To: 'Daniel Stenberg'; libcurl development
Subject: RE: CURLOPT_LOCALPORT option broken ?!

Dan, Markus,
I am not clear about the patch
"curl_interface_and_port_patch_2nd_try.diff". Do I need to use both the
interface and port all the time and should not use any one of those
In that case, if at all I have to use only the port, could I set the
interface as "" as a work-around for ADDR_ANY. Please clarify.

Thank you.

-----Original Message-----
From: Daniel Stenberg []
Sent: Friday, February 20, 2009 2:36 AM
To: libcurl development
Cc: Senthil Raja Velu
Subject: Re: CURLOPT_LOCALPORT option broken ?!

On Fri, 20 Feb 2009, wrote:

> applied a bad patch, binding a specific port without interface will

Ah nice. Looks fine to me. Thanks!

Senthil, can you confirm that this patch fixes your problem?

Received on 2009-02-21