On Sat, Feb 13, 2021 at 06:26:02PM +0100, Eric Faurot wrote:
> Hi.
>
> The diff seems to work for the few people who tested it (thanks).
> Anyone wants to ok this?
I read through the diff several times, but I'm not familiar with smtpd
so cannot claim a thorough review. Nothing really stood out as odd or
wrong. I like the simplification a lot.
ok tb
I only have these two trivial remarks:
> int
> -io_start_tls(struct io *io, void *tls)
> +io_accept_tls(struct io *io, struct tls *tls)
> {
> int mode;
>
> mode = io->flags & IO_RW;
> - if (mode == 0 || mode == IO_RW)
> - errx(1, "io_start_tls(): full-duplex or unset");
> + if (mode != IO_READ)
> + errx(1, "io_connect_tls: expect IO_READ mode");
should be io_accept_tls
>
> if (io->tls)
> errx(1, "io_start_tls(): TLS already started");
dito
> io->tls = tls;
> + io->state = IO_STATE_ACCEPT_TLS;
> + io_reset(io, EV_READ, io_dispatch_accept_tls);
> +
> + return (0);
> +}