Commit a7a4adcf authored by Noah Misch's avatar Noah Misch

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.
parent ff16b40f
...@@ -928,6 +928,8 @@ pq_getbyte(void) ...@@ -928,6 +928,8 @@ pq_getbyte(void)
int int
pq_peekbyte(void) pq_peekbyte(void)
{ {
Assert(PqCommReadingMsg);
while (PqRecvPointer >= PqRecvLength) while (PqRecvPointer >= PqRecvLength)
{ {
if (pq_recvbuf()) /* If nothing in buffer, then recv some */ if (pq_recvbuf()) /* If nothing in buffer, then recv some */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment