git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debug tidying
[exim.git]
/
src
/
src
/
transport.c
diff --git
a/src/src/transport.c
b/src/src/transport.c
index d92ad4c370656f1463785d9bec739d6fce432f50..d2cb8c235b083eecdfc8f62a8462cbd323118d5e 100644
(file)
--- a/
src/src/transport.c
+++ b/
src/src/transport.c
@@
-265,6
+265,7
@@
for (int i = 0; i < 100; i++)
}
else /* Timeout wanted. */
{
}
else /* Timeout wanted. */
{
+ sigalrm_seen = FALSE;
ALARM(local_timeout);
rc = tpt_write(fd, block, len, more, tctx->options);
save_errno = errno;
ALARM(local_timeout);
rc = tpt_write(fd, block, len, more, tctx->options);
save_errno = errno;
@@
-1188,7
+1189,8
@@
transport_write_message(transport_ctx * tctx, int size_limit)
{
BOOL last_filter_was_NL = TRUE;
BOOL save_spool_file_wireformat = f.spool_file_wireformat;
{
BOOL last_filter_was_NL = TRUE;
BOOL save_spool_file_wireformat = f.spool_file_wireformat;
-int rc, len, yield, fd_read, fd_write, save_errno;
+BOOL yield;
+int rc, len, fd_read, fd_write, save_errno;
int pfd[2] = {-1, -1};
pid_t filter_pid, write_pid;
int pfd[2] = {-1, -1};
pid_t filter_pid, write_pid;
@@
-1232,10
+1234,10
@@
write_pid = (pid_t)(-1);
{
int bits = fcntl(tctx->u.fd, F_GETFD);
{
int bits = fcntl(tctx->u.fd, F_GETFD);
- (void)fcntl(tctx->u.fd, F_SETFD, bits | FD_CLOEXEC);
+ (void)
fcntl(tctx->u.fd, F_SETFD, bits | FD_CLOEXEC);
filter_pid = child_open(USS transport_filter_argv, NULL, 077,
filter_pid = child_open(USS transport_filter_argv, NULL, 077,
-
&fd_write, &fd_read, FALSE
);
- (void)fcntl(tctx->u.fd, F_SETFD, bits & ~FD_CLOEXEC);
+
&fd_write, &fd_read, FALSE, US"transport-filter"
);
+ (void)
fcntl(tctx->u.fd, F_SETFD, bits & ~FD_CLOEXEC);
}
if (filter_pid < 0) goto TIDY_UP; /* errno set */
}
if (filter_pid < 0) goto TIDY_UP; /* errno set */
@@
-1248,7
+1250,7
@@
via a(nother) pipe. While writing to the filter, we do not do the CRLF,
smtp dots, or check string processing. */
if (pipe(pfd) != 0) goto TIDY_UP; /* errno set */
smtp dots, or check string processing. */
if (pipe(pfd) != 0) goto TIDY_UP; /* errno set */
-if ((write_pid = exim_fork(US"t
ransport fil
ter")) == 0)
+if ((write_pid = exim_fork(US"t
pt-filter-wri
ter")) == 0)
{
BOOL rc;
(void)close(fd_read);
{
BOOL rc;
(void)close(fd_read);
@@
-1272,7
+1274,7
@@
if ((write_pid = exim_fork(US"transport filter")) == 0)
!= sizeof(struct timeval)
)
rc = FALSE; /* compiler quietening */
!= sizeof(struct timeval)
)
rc = FALSE; /* compiler quietening */
- exim_underbar_exit(0, US"tpt-filter");
+ exim_underbar_exit(0, US"tpt-filter
writer
");
}
save_errno = errno;
}
save_errno = errno;
@@
-1320,6
+1322,7
@@
for (;;)
ALARM_CLR(0);
if (sigalrm_seen)
{
ALARM_CLR(0);
if (sigalrm_seen)
{
+ DEBUG(D_transport) debug_printf("timed out reading from filter\n");
errno = ETIMEDOUT;
f.transport_filter_timed_out = TRUE;
goto TIDY_UP;
errno = ETIMEDOUT;
f.transport_filter_timed_out = TRUE;
goto TIDY_UP;
@@
-1438,7
+1441,7
@@
DEBUG(D_transport)
{
debug_printf("end of filtering transport writing: yield=%d\n", yield);
if (!yield)
{
debug_printf("end of filtering transport writing: yield=%d\n", yield);
if (!yield)
- debug_printf("errno=%d more_errno=%d\n", errno, tctx->addr->more_errno);
+ debug_printf("
errno=%d more_errno=%d\n", errno, tctx->addr->more_errno);
}
return yield;
}
return yield;
@@
-1731,6
+1734,7
@@
while (1)
}
/* first thing remove current message id if it exists */
}
/* first thing remove current message id if it exists */
+ /*XXX but what if it has un-sent addrs? */
for (i = 0; i < msgq_count; ++i)
if (Ustrcmp(msgq[i].message_id, message_id) == 0)
for (i = 0; i < msgq_count; ++i)
if (Ustrcmp(msgq[i].message_id, message_id) == 0)
@@
-1954,7
+1958,7
@@
int status;
DEBUG(D_transport) debug_printf("transport_pass_socket entered\n");
DEBUG(D_transport) debug_printf("transport_pass_socket entered\n");
-if ((pid = exim_fork(US"continued-transport
interproc")) == 0)
+if ((pid = exim_fork(US"continued-transport
-
interproc")) == 0)
{
/* Disconnect entirely from the parent process. If we are running in the
test harness, wait for a bit to allow the previous process time to finish,
{
/* Disconnect entirely from the parent process. If we are running in the
test harness, wait for a bit to allow the previous process time to finish,
@@
-1962,10
+1966,7
@@
if ((pid = exim_fork(US"continued-transport interproc")) == 0)
automatic comparison. */
if ((pid = exim_fork(US"continued-transport")) != 0)
automatic comparison. */
if ((pid = exim_fork(US"continued-transport")) != 0)
- {
- DEBUG(D_transport) debug_printf("transport_pass_socket succeeded (final-pid %d)\n", pid);
_exit(EXIT_SUCCESS);
_exit(EXIT_SUCCESS);
- }
testharness_pause_ms(1000);
transport_do_pass_socket(transport_name, hostname, hostaddress,
testharness_pause_ms(1000);
transport_do_pass_socket(transport_name, hostname, hostaddress,
@@
-1980,7
+1981,6
@@
if (pid > 0)
{
int rc;
while ((rc = wait(&status)) != pid && (rc >= 0 || errno != ECHILD));
{
int rc;
while ((rc = wait(&status)) != pid && (rc >= 0 || errno != ECHILD));
- DEBUG(D_transport) debug_printf("transport_pass_socket succeeded (inter-pid %d)\n", pid);
return TRUE;
}
else
return TRUE;
}
else