Tom Lane <tgl@sss.pgh.pa.us> writes:
> Neil Conway <neilc@samurai.com> writes:
>
> > ! /*
> > ! * We don't actually use the startup packet length the frontend sent
> > ! * us; however, it's a reasonable sanity check to ensure that we
> > ! * read as much data as we expected to.
> > ! *
> > ! * The actual startup packet size is the length of the buffer, plus
> > ! * the size part of the message (4 bytes), plus a terminator.
> > ! */
> > ! Assert(len == (buf.len + 4 + 1));
>
> This takes a non-problem and converts it into a problem, no?
>
> There may be existing clients out there that miscompute the password
> packet length. Right now that does no harm. With an Assert in place
> in the backend, it will cause a database system restart.
Good point. However, I still think a sanity check would be appropriate
here. How about an elog(WARNING) ?
> On the subject of the timeout calculations, this code still looks
> utterly bizarre:
[...]
Yes, I agree. I tried to improve things a little bit, but there's
still some code that I was scratching my head over. If you'd like to
take a shot at rewriting it, go ahead; otherwise I might do it
eventually...
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC