diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index faf2c569da..e1650ca4f0 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -1410,6 +1410,9 @@ keep_going: /* We will come back to here until there is closesocket(conn->sock); conn->sock = -1; conn->status = CONNECTION_NEEDED; + /* Discard any unread/unsent data */ + conn->inStart = conn->inCursor = conn->inEnd = 0; + conn->outCount = 0; goto keep_going; } else @@ -1447,6 +1450,9 @@ keep_going: /* We will come back to here until there is closesocket(conn->sock); conn->sock = -1; conn->status = CONNECTION_NEEDED; + /* Discard any unread/unsent data */ + conn->inStart = conn->inCursor = conn->inEnd = 0; + conn->outCount = 0; goto keep_going; } } @@ -1560,6 +1566,9 @@ keep_going: /* We will come back to here until there is closesocket(conn->sock); conn->sock = -1; conn->status = CONNECTION_NEEDED; + /* Discard any unread/unsent data */ + conn->inStart = conn->inCursor = conn->inEnd = 0; + conn->outCount = 0; goto keep_going; } @@ -1626,6 +1635,9 @@ keep_going: /* We will come back to here until there is closesocket(conn->sock); conn->sock = -1; conn->status = CONNECTION_NEEDED; + /* Discard any unread/unsent data */ + conn->inStart = conn->inCursor = conn->inEnd = 0; + conn->outCount = 0; goto keep_going; } @@ -1645,6 +1657,9 @@ keep_going: /* We will come back to here until there is closesocket(conn->sock); conn->sock = -1; conn->status = CONNECTION_NEEDED; + /* Discard any unread/unsent data */ + conn->inStart = conn->inCursor = conn->inEnd = 0; + conn->outCount = 0; goto keep_going; } #endif