Expansions: New ${ipv6denorm:<string>} and ${ipv6norm:<string>} operators. Bug 1650
[exim.git] / src / src / ip.c
index 7991a5850f3611e4c5ca2512d2ff834f97244ad6..1e3875aef51e388034af1c3f68d3bf805ab9b220 100644 (file)
@@ -237,7 +237,11 @@ if (running_in_test_harness  && save_errno == ECONNREFUSED && timeout == 999999)
 
 /* Success */
 
-if (rc >= 0) return 0;
+if (rc >= 0)
+  {
+  callout_address = string_sprintf("[%s]:%d", address, port);
+  return 0;
+  }
 
 /* A failure whose error code is "Interrupted system call" is in fact
 an externally applied timeout if the signal handler has been run. */
@@ -400,6 +404,7 @@ if (connect(sock, (struct sockaddr *) &server, sizeof(server)) < 0)
                path, strerror(err));
   return -1;
   }
+callout_address = string_copy(path);
 return sock;
 }
 
@@ -455,7 +460,7 @@ time_t start_recv = time(NULL);
 int time_left = timeout;
 int rc;
 
-if (timeout <= 0)
+if (time_left <= 0)
   {
   errno = ETIMEDOUT;
   return FALSE;
@@ -484,8 +489,10 @@ do
   if (rc < 0 && errno == EINTR)
     {
     DEBUG(D_transport) debug_printf("EINTR while waiting for socket data\n");
+
     /* Watch out, 'continue' jumps to the condition, not to the loops top */
-    if (time_left = timeout - (time(NULL) - start_recv)) continue;
+    time_left = timeout - (time(NULL) - start_recv);
+    if (time_left > 0) continue;
     }
 
   if (rc <= 0)