nghttpx: Call disconnect() when memcached connection cannot be made

This commit is contained in:
Tatsuhiro Tsujikawa 2015-07-28 21:19:27 +09:00
parent f1b163a32c
commit 6ad332b801
1 changed files with 3 additions and 4 deletions

View File

@ -532,10 +532,9 @@ int MemcachedConnection::add_request(std::unique_ptr<MemcachedRequest> req) {
return 0;
}
if (conn_.fd == -1) {
if (initiate_connection() != 0) {
return -1;
}
if (conn_.fd == -1 && initiate_connection() != 0) {
disconnect();
return -1;
}
return 0;