Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78980: pgsqlGetNotify() overlooks dead connection
This commit is contained in:
Nikita Popov 2019-12-20 11:44:23 +01:00
commit f974f252dd
2 changed files with 20 additions and 2 deletions

View file

@ -1068,13 +1068,21 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
H = (pdo_pgsql_db_handle *)dbh->driver_data;
PQconsumeInput(H->server);
if (!PQconsumeInput(H->server)) {
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
pgsql_notify = PQnotifies(H->server);
if (ms_timeout && !pgsql_notify) {
php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, (int)ms_timeout);
PQconsumeInput(H->server);
if (!PQconsumeInput(H->server)) {
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
pgsql_notify = PQnotifies(H->server);
}