mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Don't send "cannot connect" errors on invalid startup packet
Commit 16671ba6e7
moved the code that sends "sorry, too many clients
already" and other such messages, but it had the effect that we would
send that error even if the the startup packet processing failed, e.g.
because the client sent an invalid startup packet. That was not
intentional.
Spotted while reading the code again.
This commit is contained in:
@@ -4354,6 +4354,8 @@ BackendInitialize(Port *port)
|
|||||||
* now instead of wasting cycles on an authentication exchange. (This also
|
* now instead of wasting cycles on an authentication exchange. (This also
|
||||||
* allows a pg_ping utility to be written.)
|
* allows a pg_ping utility to be written.)
|
||||||
*/
|
*/
|
||||||
|
if (status == STATUS_OK)
|
||||||
|
{
|
||||||
switch (port->canAcceptConnections)
|
switch (port->canAcceptConnections)
|
||||||
{
|
{
|
||||||
case CAC_STARTUP:
|
case CAC_STARTUP:
|
||||||
@@ -4391,6 +4393,7 @@ BackendInitialize(Port *port)
|
|||||||
case CAC_OK:
|
case CAC_OK:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable the timeout, and prevent SIGTERM again.
|
* Disable the timeout, and prevent SIGTERM again.
|
||||||
|
Reference in New Issue
Block a user