postgres.git / summary / log / commit / refs

commit    a7a4adcf8d1e5a34a15ad86aee7d6aa0b8c15d43
Author:   Noah Misch <noah@leadboat.com>
Date:     Sat Feb 07 04:14:27 2015 +0000
First released in: 9.5.0

    Assert(PqCommReadingMsg) in pq_peekbyte().
    
    Interrupting pq_recvbuf() can break protocol sync, so its callers all
    deserve this assertion.  The one pq_peekbyte() caller suffices already.


src/backend/libpq/pqcomm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 0d97aa45fbc..09dea4bbe16 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -928,6 +928,8 @@ pq_getbyte(void) int pq_peekbyte(void) { + Assert(PqCommReadingMsg); + while (PqRecvPointer >= PqRecvLength) { if (pq_recvbuf()) /* If nothing in buffer, then recv some */ [parent: ff16b40f8cac]