summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-11-18 13:17:06 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-11-18 23:54:38 +0100
commitc7cd781a63c91b8e8496ae8581bf2db40934f863 (patch)
tree56f0735f834b8852f900836a2095a6fc8271a9d2 /lib
parent18383fbf72b31b9ae58f17df8e75158a818c31eb (diff)
downloadcurl-c7cd781a63c91b8e8496ae8581bf2db40934f863.tar.gz
urldata: change port num storage to int and unsigned short
Instead of long. Closes #9946
Diffstat (limited to 'lib')
-rw-r--r--lib/setopt.c2
-rw-r--r--lib/urldata.h8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index d53131a0e..a12526176 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -1057,7 +1057,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
arg = va_arg(param, long);
if((arg < 0) || (arg > 65535))
return CURLE_BAD_FUNCTION_ARGUMENT;
- data->set.proxyport = arg;
+ data->set.proxyport = (unsigned short)arg;
break;
case CURLOPT_PROXYAUTH:
diff --git a/lib/urldata.h b/lib/urldata.h
index c50171e73..5691fec3e 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -865,7 +865,7 @@ struct postponed_data {
struct proxy_info {
struct hostname host;
- long port;
+ int port;
unsigned char proxytype; /* curl_proxytype: what kind of proxy that is in
use */
char *user; /* proxy user name string, allocated */
@@ -1622,12 +1622,12 @@ struct UserDefined {
FILE *err; /* the stderr user data goes here */
void *debugdata; /* the data that will be passed to fdebug */
char *errorbuffer; /* (Static) store failure messages in here */
- long proxyport; /* If non-zero, use this port number by default. If the
- proxy string features a ":[port]" that one will override
- this. */
void *out; /* CURLOPT_WRITEDATA */
void *in_set; /* CURLOPT_READDATA */
void *writeheader; /* write the header to this if non-NULL */
+ unsigned short proxyport; /* If non-zero, use this port number by
+ default. If the proxy string features a
+ ":[port]" that one will override this. */
unsigned short use_port; /* which port to use (when not using default) */
unsigned long httpauth; /* kind of HTTP authentication to use (bitmask) */
unsigned long proxyauth; /* kind of proxy authentication to use (bitmask) */