| | @@ -232,33 +232,5 @@ |
| 232 | 232 | N -= (size_t)got; |
| 233 | 233 | pContent = (void*)&((char*)pContent)[got]; |
| 234 | 234 | } |
| 235 | 235 | return total; |
| 236 | 236 | } |
| 237 | | - |
| 238 | | -/* |
| 239 | | -** Attempt to resolve pUrlData->name to an IP address and setup g.zIpAddr |
| 240 | | -** so rcvfrom gets populated. For hostnames with more than one IP (or |
| 241 | | -** if overridden in ~/.ssh/config) the rcvfrom may not match the host |
| 242 | | -** to which we connect. |
| 243 | | -*/ |
| 244 | | -void socket_ssh_resolve_addr(UrlData *pUrlData){ |
| 245 | | - struct addrinfo *ai = 0; |
| 246 | | - struct addrinfo hints; |
| 247 | | - char zRemote[NI_MAXHOST]; |
| 248 | | - memset(&hints, 0, sizeof(hints)); |
| 249 | | - hints.ai_family = AF_UNSPEC; |
| 250 | | - hints.ai_socktype = SOCK_STREAM; |
| 251 | | - hints.ai_protocol = IPPROTO_TCP; |
| 252 | | - fossil_free(g.zIpAddr); |
| 253 | | - g.zIpAddr = 0; |
| 254 | | - if( getaddrinfo(pUrlData->name, NULL, &hints, &ai)==0 |
| 255 | | - && ai!=0 |
| 256 | | - && getnameinfo(ai->ai_addr, ai->ai_addrlen, zRemote, |
| 257 | | - sizeof(zRemote), 0, 0, NI_NUMERICHOST)==0 ){ |
| 258 | | - g.zIpAddr = mprintf("%s (%s)", zRemote, pUrlData->name); |
| 259 | | - } |
| 260 | | - if( ai ) freeaddrinfo(ai); |
| 261 | | - if( g.zIpAddr==0 ){ |
| 262 | | - g.zIpAddr = mprintf("%s", pUrlData->name); |
| 263 | | - } |
| 264 | | -} |
| 265 | 237 | |