Properly check for connection trouble in the pgsql example

This commit is contained in:
Joris Vink 2014-08-14 15:13:47 +02:00
parent 9ea1e3cb57
commit 0b3c918ba6
1 changed files with 2 additions and 5 deletions

View File

@ -97,11 +97,8 @@ request_perform_query(struct http_request *req)
/* Fire off the query. */
if (!kore_pgsql_async(&state->sql, req, "SELECT * FROM coders")) {
/*
* If the sql was NULL we need to retry as there was no
* available connection.
*/
if (state->sql.conn == NULL) {
/* If the state was still INIT, we'll try again later. */
if (state->sql.state == KORE_PGSQL_STATE_INIT) {
req->fsm_state = REQ_STATE_QUERY;
return (HTTP_STATE_RETRY);
}