Re: Parent/child choice in sslio

Gerrit Pape <[email protected]>
Newsgroups gmane.comp.misc.pape.general
Message-ID <20040514140114.20866.qmail@221b2fb4b7139b.315fe32.mid.smarden.org>
On Thu, May 13, 2004 at 01:59:29PM -0400, Charlie Brady wrote:
> I've made use of sslio to add TLS support to Bruce Guenter's mailfront 
> (see the bgware list for details). But I found debugging quite confusion 
> because of the decision that sslio makes about the allocation of tasks to 
> the parent and child after it forks.

> What confused me was than I had an smtpfront-qmail process (pid N) before 
> I gave the STARTTLS command, then had an smtpfront-qmail process (pid N) 
> and child sslio process (pid N+1) after. It took a bit of head scratching 
> to realise that process N was smtpfront-qmail, then sslio, then 
> smtpfront-qmail again.
> 
> This patch would have avoided the confusion:
[...]

The sslio program runs as a child process of the actual service program
(here: smtpfront-qmail), as documented in the sslio man page.  Your patch
changes that and lets the service program run as a child process of sslio.
Although the current behavior might confuse you as a developer, I think it
less confuses users, because the tcpsvd or tcpserver logs don't change,
e.g.:

2004-05-14_13:41:58.09972 tcpsvd: info: status 2/40
2004-05-14_13:41:58.09994 tcpsvd: info: pid 19443 from 64.246.56.43
                                            ^^^^^
2004-05-14_13:41:58.10053 tcpsvd: info: concurrency 19443 64.246.56.43 1/10
2004-05-14_13:41:58.10055 tcpsvd: info: start 19443 smarden.org:212.21.76.77 :svr32.ehostpros.com:64.246.56.43:45481 
2004-05-14_13:41:58.59697 smtpfront-qmail[19443]: MAIL FROM:<> SIZE=3943
                                          ^^^^^
2004-05-14_13:41:58.59702 smtpfront-qmail[19443]: RCPT TO:<[email protected]>
2004-05-14_13:41:58.59705 smtpfront-qmail[19443]: 553 This address cannot get bounces, the envelope of the mail you bounce is forged.
2004-05-14_13:41:58.59708 smtpfront-qmail[19443]: 503 You must send RCPT TO: first
2004-05-14_13:41:59.04260 smtpfront-qmail[19443]: bytes in: 93 bytes out: 238
2004-05-14_13:41:59.04276 tcpsvd: info: end 19443 exit 0
                                            ^^^^^      ^
2004-05-14_13:41:59.04279 tcpsvd: info: status 1/40

The pid announced by tcpsvd is the pid of the service program, and also
the exit code is the one of the service program.  If this would be the
sslio process, I think it would cause more confusion.  sslio follows the
example of recordio here.

Regards, Gerrit.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.