Search Postgresql Archives

Re: PQconsumeinput() may close the fd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Laurenz Albe <laurenz.albe@xxxxxxxxxxx> writes:
> On Fri, 2022-10-21 at 07:27 +0300, Vasily Kulikov wrote:
>> The problem is that sometimes PQconsumeInput() may close the connection

> The function does nothing of the kind.

No, he's right: if we detect EOF then we'll close the socket.
However, not doing so wouldn't be an improvement.  I believe the
socket would still be read-ready so you'd have an infinite loop.

What I'd suggest doing is checking for PQstatus(conn) == CONNECTION_BAD,
or else directly rechecking PQsocket() each time, rather than assuming
the socket is still there.

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux