Qmail
[Top] [All Lists]

Re: preferred way to read from from file descriptor 6 in ucspi

To: qmail@list.cr.yp.to
Subject: Re: preferred way to read from from file descriptor 6 in ucspi
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
Date: Wed, 11 Apr 2007 13:54:30 +0200 (CEST)
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-qmail@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list qmail@list.cr.yp.to
In-reply-to: <20070411073938.6822.qmail@rahul.net>
Mailing-list: contact qmail-help@list.cr.yp.to; run by ezmlm
References: <20070411073938.6822.qmail@rahul.net>
+ conover@rahul.net (John Conover):

| Is there a preferred, (as in official,) way to read from file
| descriptor 6 in ucspi?
| 
| Something like:
| 
|     while ((cnt = read (6, buf, MAXBUF)) >= 0)
|     {
| 
| has some issues with network latency and EOT.

You could take a look at the qmail source code to find out how DJB
does it.  In qmail-smtpd, for example, he reads input one character at
a time until a newline arrives, then parses the result.  Even the body
of the mail is read a byte at a time.

- Harald

<Prev in Thread] Current Thread [Next in Thread>