check for CONNECTION_BAD status before calling PQsetnonblocking
This commit is contained in:
parent
125075b796
commit
60130a933d
@ -329,11 +329,6 @@ protected:
|
||||
LOG("Connection couldn't be created");
|
||||
}
|
||||
|
||||
if (PQsetnonblocking(connection_, 1) == -1) {
|
||||
LOG("Unable to set connection to non-blocking");
|
||||
return false;
|
||||
}
|
||||
|
||||
ConnStatusType status = PQstatus(connection_);
|
||||
|
||||
if(CONNECTION_BAD == status) {
|
||||
@ -341,6 +336,11 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PQsetnonblocking(connection_, 1) == -1) {
|
||||
LOG("Unable to set connection to non-blocking");
|
||||
return false;
|
||||
}
|
||||
|
||||
int fd = PQsocket(connection_);
|
||||
if(fd < 0) {
|
||||
LOG("socket fd was negative. error");
|
||||
|
Loading…
Reference in New Issue
Block a user