diff options
author | Noah Misch <noah@leadboat.com> | 2015-02-06 23:14:27 -0500 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2015-02-06 23:14:27 -0500 |
commit | a7a4adcf8d1e5a34a15ad86aee7d6aa0b8c15d43 (patch) | |
tree | 9750c2d056682ea00a4de85d9d3dc003db5af489 /src | |
parent | ff16b40f8cac67a740f4edaa9fc2d9c7ba44c73a (diff) | |
download | postgresql-a7a4adcf8d1e5a34a15ad86aee7d6aa0b8c15d43.tar.gz postgresql-a7a4adcf8d1e5a34a15ad86aee7d6aa0b8c15d43.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/pqcomm.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 */ |