Check POLLHUP if unable to read anything from network

This solves a possible infinite loop that arises after commit e81895e .
Commit e81895e prevents closing connections in case of temporary failures,
but on the other side it doesn't allow to close faulty connections.
v2.x_pg_PrepStmtBase_240714
Rene Cannao 2 years ago
parent a3193ad1dd
commit 03f0b58e1e

@ -726,6 +726,12 @@ int MySQL_Data_Stream::read_from_net() {
// it seems we end in shut_soft() anyway
}
}
if ( (revents & POLLHUP) ) {
// this is a final check
// Only if the amount of data read is 0 or less, then we check POLLHUP
proxy_debug(PROXY_DEBUG_NET, 5, "Session=%p, Datastream=%p -- shutdown soft. revents=%d , bytes read = %d\n", sess, this, revents, r);
shut_soft();
}
} else {
queue_w(queueIN,r);
bytes_info.bytes_recv+=r;

Loading…
Cancel
Save