* Attempt to read a ParameterStatus message. * This is possible in several places, so we break it out as a subroutine. * Entry: 'S' message type and length have already been consumed. * Exit: returns 0 if successfully consumed message. * returns EOF if not enough data. */
| 1579 | * returns EOF if not enough data. |
| 1580 | */ |
| 1581 | static int |
| 1582 | getParameterStatus(PGconn *conn) |
| 1583 | { |
| 1584 | PQExpBufferData valueBuf; |
| 1585 | |
| 1586 | /* Get the parameter name */ |
| 1587 | if (pqGets(&conn->workBuffer, conn)) |
| 1588 | return EOF; |
| 1589 | /* Get the parameter value (could be large) */ |
| 1590 | initPQExpBuffer(&valueBuf); |
| 1591 | if (pqGets(&valueBuf, conn)) |
| 1592 | { |
| 1593 | termPQExpBuffer(&valueBuf); |
| 1594 | return EOF; |
| 1595 | } |
| 1596 | /* And save it */ |
| 1597 | pqSaveParameterStatus(conn, conn->workBuffer.data, valueBuf.data); |
| 1598 | termPQExpBuffer(&valueBuf); |
| 1599 | return 0; |
| 1600 | } |
| 1601 | |
| 1602 | |
| 1603 | /* |
no test coverage detected