nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] fpurge()


From: Ken Hornstein
Subject: Re: [Nmh-workers] fpurge()
Date: Sat, 29 Dec 2012 13:31:11 -0500

>I've lost the original context.  Must the child be killed?  Could it
>exit when the pipe it's reading from the parent is closed instead?  That
>still leaves the issue of data sitting in the output buffer when the
>parent desires child's death and fcloses the FILE-stream.

The code in question in smtp.c is called when sm_end() is called with
an argument of NOTOK or DONE.  As far as I can tell sm_end() is never
called with DONE as an argument, so really we only care about the
NOTOK case.

When sm_end() is called with NOTOK as an argument, it means things are
messed up.  Seems like killing the child is reasonable to do here.  Given
that code segment, it would be easy to block SIGPIPE here (those two
filehandles are closed further down in sm_end()).

In mhl discard() is called in the SIGINT interrupt handler; I guess the
idea there is to prevent any more stuff from being written out.  Right
after that putchar('\n') is called, so clearly they're not worried about
SIGPIPE.  I think we could safely just remove that.

The other usage of that, in post, is a bit bizarre.  Here's the code snippet:

    start_headers ();
    if (debug) {
        verbose++;
        discard (out = stdout); /* XXX: reference discard() to help loader */

So ... based on that comment, it almost seems like the usage of discard() here
is superfluous.  I really can't think of a reason why it's needed.  Ok,
we need out = stdout, but other than that I don't know why it's needed.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]