Re: BUG: possible busy loop when connection is closed while trying to establish SSL connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: BUG: possible busy loop when connection is closed while trying to establish SSL connection
Date: 2004-09-23 14:08:15
Message-ID: 25651.1095948495@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)tm(dot)ee> writes:
>> One possibility is to forget the direct call to recv() and use
>> pqReadData --- since conn->ssl isn't set yet, and we aren't expecting
>> the server to send more than one byte, this should in theory be safe.

> I was scared by the comment before recv(...,1,0) which said we must be
> careful not to read more than 1 byte

When I wrote that, I was trying to assume as little as possible about
the SSL protocol. The only way there could be a problem is if the
server is first to send during the SSL negotiation handshake; which
seems odd but not impossible. Anyone know for sure?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-09-23 14:35:23 Re: NOFIXADE / NOPRINTADE
Previous Message Bruce Momjian 2004-09-23 13:51:56 Re: NOFIXADE / NOPRINTADE