Testsuite: OpenSSL version output variances
[exim.git] / src / src / verify.c
index 5c093bf31ca087f611454755327df700ae186058..b957c709b7f0ae0cc79429563efbc738bbb9044d 100644 (file)
@@ -2263,7 +2263,7 @@ for (h = header_list; h != NULL && yield == OK; h = h->next)
       /* deconst cast ok as we're passing a non-const to string_printing() */
       *msgptr = US string_printing(
         string_sprintf("%s: failing address in \"%.*s:\" header %s: %.*s",
-          errmess, tt - h->text, h->text, verb, len, s));
+          errmess, (int)(tt - h->text), h->text, verb, len, s));
 
       yield = FAIL;
       break;          /* Out of address loop */
@@ -2564,7 +2564,7 @@ for (i = 0; i < 3 && !done; i++)
           while (ss > s && isspace(ss[-1])) ss--;
           *log_msgptr = string_sprintf("syntax error in '%.*s' header when "
             "scanning for sender: %s in \"%.*s\"",
-            endname - h->text, h->text, *log_msgptr, ss - s, s);
+            (int)(endname - h->text), h->text, *log_msgptr, (int)(ss - s), s);
           yield = FAIL;
           done = TRUE;
           break;
@@ -2592,11 +2592,9 @@ for (i = 0; i < 3 && !done; i++)
         {
         *verrno = vaddr->basic_errno;
         if (smtp_return_error_details)
-          {
           *user_msgptr = string_sprintf("Rejected after DATA: "
             "could not verify \"%.*s\" header address\n%s: %s",
-            endname - h->text, h->text, vaddr->address, vaddr->message);
-          }
+            (int)(endname - h->text), h->text, vaddr->address, vaddr->message);
         }
 
       /* Success or defer */
@@ -2657,6 +2655,7 @@ verify_get_ident(int port)
 int sock, host_af, qlen;
 int received_sender_port, received_interface_port, n;
 uschar *p;
+blob early_data;
 uschar buffer[2048];
 
 /* Default is no ident. Check whether we want to do an ident check for this
@@ -2682,11 +2681,15 @@ if (ip_bind(sock, host_af, interface_address, 0) < 0)
   goto END_OFF;
   }
 
-/*XXX could take advantage of TFO early-data.  Hmm, what are the
-error returns; can we differentiate connect from data fails?
-Do we need to? */
+/* Construct and send the query. */
+
+qlen = snprintf(CS buffer, sizeof(buffer), "%d , %d\r\n",
+  sender_host_port, interface_port);
+early_data.data = buffer;
+early_data.len = qlen;
+
 if (ip_connect(sock, host_af, sender_host_address, port,
-               rfc1413_query_timeout, &tcp_fastopen_nodata) < 0)
+               rfc1413_query_timeout, &early_data) < 0)
   {
   if (errno == ETIMEDOUT && LOGGING(ident_timeout))
     log_write(0, LOG_MAIN, "ident connection to %s timed out",
@@ -2697,30 +2700,6 @@ if (ip_connect(sock, host_af, sender_host_address, port,
   goto END_OFF;
   }
 
-/* Construct and send the query. */
-
-sprintf(CS buffer, "%d , %d\r\n", sender_host_port, interface_port);
-qlen = Ustrlen(buffer);
-if (send(sock, buffer, qlen, 0) < 0)
-  if (errno == ENOTCONN)       /* seen for TFO on FreeBSD */
-    {
-    struct timeval tv = { .tv_sec = 0, .tv_usec = 500*1000 };
-    fd_set s;
-
-    FD_ZERO(&s); FD_SET(sock, &s);
-    (void) select(sock+1, NULL,  (SELECT_ARG2_TYPE *)&s, (SELECT_ARG2_TYPE *)&s, &tv);
-    if (send(sock, buffer, qlen, 0) < 0)
-      {
-      DEBUG(D_ident) debug_printf("ident re-send failed: %s\n", strerror(errno));
-      goto END_OFF;
-      }
-    }
-  else
-    {
-    DEBUG(D_ident) debug_printf("ident send failed: %s\n", strerror(errno));
-    goto END_OFF;
-    }
-
 /* Read a response line. We put it into the rest of the buffer, using several
 recv() calls if necessary. */