Fossil SCM

Make sure the g.zIpAddr is reset for each new ssh: URL.

drh 2021-10-26 16:17 trunk
Commit be18690cada2044dc3fbaf3f79fc130cf1e7a377c542e4160003ba35c6036942
1 file changed +2
--- src/http_socket.c
+++ src/http_socket.c
@@ -247,10 +247,12 @@
247247
char zRemote[NI_MAXHOST];
248248
memset(&hints, 0, sizeof(hints));
249249
hints.ai_family = AF_UNSPEC;
250250
hints.ai_socktype = SOCK_STREAM;
251251
hints.ai_protocol = IPPROTO_TCP;
252
+ fossil_free(g.zIpAddr);
253
+ g.zIpAddr = 0;
252254
if( getaddrinfo(pUrlData->name, NULL, &hints, &ai)==0
253255
&& ai!=0
254256
&& getnameinfo(ai->ai_addr, ai->ai_addrlen, zRemote,
255257
sizeof(zRemote), 0, 0, NI_NUMERICHOST)==0 ){
256258
g.zIpAddr = mprintf("%s (%s)", zRemote, pUrlData->name);
257259
--- src/http_socket.c
+++ src/http_socket.c
@@ -247,10 +247,12 @@
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 if( getaddrinfo(pUrlData->name, NULL, &hints, &ai)==0
253 && ai!=0
254 && getnameinfo(ai->ai_addr, ai->ai_addrlen, zRemote,
255 sizeof(zRemote), 0, 0, NI_NUMERICHOST)==0 ){
256 g.zIpAddr = mprintf("%s (%s)", zRemote, pUrlData->name);
257
--- src/http_socket.c
+++ src/http_socket.c
@@ -247,10 +247,12 @@
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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button