aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-01-30 08:24:07 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-01-30 08:24:07 +0000
commit2fbf94b0f309de9bd9153274bb475abc744afb0a (patch)
treef2e9a364ed27e4f115931be6e424138268b6bee0 /lib/url.c
parent32bc30e210ea41552f3dee64edd290a129020dc7 (diff)
Added CURLOPT_LOCALPORT and CURLOPT_LOCALPORTRANGE to libcurl. Set with the
curl tool with --local-port. Plain and simply set the range of ports to bind the local end of connections to. Implemented on to popular demand. Not extensively tested. Please let me know how it works.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index a4bd0f509..f17213f79 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1222,13 +1222,26 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
*/
data->set.crlf = va_arg(param, long)?TRUE:FALSE;
break;
+
case CURLOPT_INTERFACE:
/*
- * Set what interface to bind to when performing an operation and thus
- * what from-IP your connection will use.
+ * Set what interface or address/hostname to bind the socket to when
+ * performing an operation and thus what from-IP your connection will use.
*/
data->set.device = va_arg(param, char *);
break;
+ case CURLOPT_LOCALPORT:
+ /*
+ * Set what local port to bind the socket to when performing an operation.
+ */
+ data->set.localport = (unsigned short) va_arg(param, long);
+ break;
+ case CURLOPT_LOCALPORTRANGE:
+ /*
+ * Set number of local ports to try, starting with CURLOPT_LOCALPORT.
+ */
+ data->set.localportrange = (int) va_arg(param, long);
+ break;
case CURLOPT_KRB4LEVEL:
/*
* A string that defines the krb4 security level.