| 1983 | */ |
| 1984 | |
| 1985 | int |
| 1986 | PQisBusy(PGconn *conn) |
| 1987 | { |
| 1988 | if (!conn) |
| 1989 | return false; |
| 1990 | |
| 1991 | /* Parse any available data, if our state permits. */ |
| 1992 | parseInput(conn); |
| 1993 | |
| 1994 | /* |
| 1995 | * PQgetResult will return immediately in all states except BUSY. Also, |
| 1996 | * if we've detected read EOF and dropped the connection, we can expect |
| 1997 | * that PQgetResult will fail immediately. Note that we do *not* check |
| 1998 | * conn->write_failed here --- once that's become set, we know we have |
| 1999 | * trouble, but we need to keep trying to read until we have a complete |
| 2000 | * server message or detect read EOF. |
| 2001 | */ |
| 2002 | return conn->asyncStatus == PGASYNC_BUSY && conn->status != CONNECTION_BAD; |
| 2003 | } |
| 2004 | |
| 2005 | /* |
| 2006 | * PQgetResult |