mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Cancel running query if it is detected that the connection to the client is
lost. The only way we detect that at the moment is when write() fails when we try to write to the socket. Florian Pflug with small changes by me, reviewed by Greg Jaskiewicz.
This commit is contained in:
@ -1247,9 +1247,13 @@ internal_flush(void)
|
||||
|
||||
/*
|
||||
* We drop the buffered data anyway so that processing can
|
||||
* continue, even though we'll probably quit soon.
|
||||
* continue, even though we'll probably quit soon. We also
|
||||
* set a flag that'll cause the next CHECK_FOR_INTERRUPTS
|
||||
* to terminate the connection.
|
||||
*/
|
||||
PqSendStart = PqSendPointer = 0;
|
||||
ClientConnectionLost = 1;
|
||||
InterruptPending = 1;
|
||||
return EOF;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user