]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/spool_in.c
Testsuite: handle slow test-hosts more intelligently
[user/henk/code/exim.git] / src / src / spool_in.c
index 25e431b2bd8a7133c8e2909266b12671c5a1e153..7c60a12a0060152b05218ab70b243a2fc6e54c19 100644 (file)
@@ -341,7 +341,6 @@ int n;
 int rcount = 0;
 long int uid, gid;
 BOOL inheader = FALSE;
-uschar *p;
 
 /* Reset all the global variables to their default values. However, there is
 one exception. DO NOT change the default value of dont_deliver, because it may
@@ -387,7 +386,8 @@ and the number of warning messages for delivery delays that have been sent. */
 
 if (Ufgets(big_buffer, big_buffer_size, fp) == NULL) goto SPOOL_READ_ERROR;
 
-p = big_buffer + Ustrlen(big_buffer);
+{
+uschar *p = big_buffer + Ustrlen(big_buffer);
 while (p > big_buffer && isspace(p[-1])) p--;
 *p = 0;
 if (!isdigit(p[-1])) goto SPOOL_FORMAT_ERROR;
@@ -400,6 +400,7 @@ while (p > big_buffer && (isdigit(p[-1]) || '-' == p[-1])) p--;
 uid = Uatoi(p);
 if (p <= big_buffer || *(--p) != ' ') goto SPOOL_FORMAT_ERROR;
 *p = 0;
+}
 
 originator_login = string_copy(big_buffer);
 originator_uid = (uid_t)uid;
@@ -422,12 +423,16 @@ if (sscanf(CS big_buffer, TIME_T_FMT " %d", &received_time.tv_sec, &warning_coun
 received_time.tv_usec = 0;
 
 message_age = time(NULL) - received_time.tv_sec;
+#ifndef COMPILE_UTILITY
+if (f.running_in_test_harness)
+  message_age = test_harness_fudged_queue_time(message_age);
+#endif
 
 #ifndef COMPILE_UTILITY
 DEBUG(D_deliver) debug_printf("user=%s uid=%ld gid=%ld sender=%s\n",
   originator_login, (long int)originator_uid, (long int)originator_gid,
   sender_address);
-#endif  /* COMPILE_UTILITY */
+#endif
 
 /* Now there may be a number of optional lines, each starting with "-". If you
 add a new setting here, make sure you set the default above.
@@ -449,6 +454,7 @@ for (;;)
   int len;
   BOOL tainted;
   uschar * var;
+  const uschar * p;
 
   if (Ufgets(big_buffer, big_buffer_size, fp) == NULL) goto SPOOL_READ_ERROR;
   if (big_buffer[0] != '-') break;
@@ -659,7 +665,7 @@ for (;;)
     case 't':
     if (Ustrncmp(p, "ls_", 3) == 0)
       {
-      uschar * q = p + 3;
+      const uschar * q = p + 3;
       if (Ustrncmp(q, "certificate_verified", 20) == 0)
        tls_in.certificate_verified = TRUE;
       else if (Ustrncmp(q, "cipher", 6) == 0)