From ae64c4a3538005d50f2bf3067b48e6865f57bfda Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 21 Jan 1997 23:27:48 +0000 Subject: Handle zero-length messages. svn path=/trunk/; revision=799 --- driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 0fd2b145..5c3f926f 100644 --- a/driver.c +++ b/driver.c @@ -474,9 +474,11 @@ char *realname; /* real name of host */ received_for = parse_received(ctl, bufp); #endif /* HAVE_RES_SEARCH */ - continue; - } - else if (headers) /* OK, we're at end of headers now */ + if (len > 0) + continue; + } /* if (inheaders) */ + + if (headers && (!inheaders || len == 0)) /* at end of headers now */ { char *cp; struct idlist *idp, *xmit_names; @@ -713,6 +715,16 @@ char *realname; /* real name of host */ } free_str_list(&xmit_names); + } /* else if (headers) */ + + /* output a crlf if zero length message body */ + if (!len && inheaders) + { + if (ctl->mda[0]) + fputs("\r\n", sinkfp); + else if (sinkfp) + SockWrite("\r\n", 1, 2, sinkfp); + continue; } /* following code is executed on non-header lines only */ -- cgit v1.2.3