memcpy(data->info.conn_local_ip, conn->local_ip, MAX_IPADR_LEN);
data->info.conn_scheme = conn->handler->scheme;
data->info.conn_protocol = conn->handler->protocol;
- data->info.conn_primary_port = conn->primary_port;
+ data->info.conn_primary_port = conn->port;
data->info.conn_local_port = conn->local_port;
}
char buffer[STRERROR_LEN];
struct Curl_sockaddr_storage ssrem;
curl_socklen_t plen;
+ long port;
plen = sizeof(struct Curl_sockaddr_storage);
memset(&ssrem, 0, sizeof(ssrem));
if(getpeername(sockfd, (struct sockaddr*) &ssrem, &plen)) {
return;
}
if(!Curl_addr2string((struct sockaddr*)&ssrem, plen,
- conn->primary_ip, &conn->primary_port)) {
+ conn->primary_ip, &port)) {
failf(data, "ssrem inet_ntop() failed with errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));
return;
curl_proxytype proxytype)
{
char *portptr = NULL;
- long port = -1;
+ int port = -1;
char *proxyuser = NULL;
char *proxypasswd = NULL;
char *host;
curl_url_get(uhp, CURLUPART_PORT, &portptr, 0);
if(portptr) {
- port = strtol(portptr, NULL, 10);
+ port = (int)strtol(portptr, NULL, 10);
free(portptr);
}
else {
if(data->set.proxyport)
/* None given in the proxy string, then get the default one if it is
given */
- port = data->set.proxyport;
+ port = (int)data->set.proxyport;
else {
if(proxytype == CURLPROXY_HTTPS)
port = CURL_DEFAULT_HTTPS_PROXY_PORT;
struct connectdata *conn,
unsigned int checks_to_perform);
- long defport; /* Default port. */
+ int defport; /* Default port. */
unsigned int protocol; /* See CURLPROTO_* - this needs to be the single
specific protocol bit */
unsigned int family; /* single bit for protocol family; basically the
struct proxy_info socks_proxy;
struct proxy_info http_proxy;
#endif
- long port; /* which port to use locally */
+ int port; /* which port to use locally - to connect to */
int remote_port; /* the remote port, not the proxy port! */
int conn_to_port; /* the remote port to connect to. valid only if
bits.conn_to_port is set */
these are updated with data which comes directly from the socket. */
char primary_ip[MAX_IPADR_LEN];
- long primary_port;
/* 'local_ip' and 'local_port' get filled with local's numerical
ip address and port number whenever an outgoing connection is