Don't print "Fatal" if EOF is received and all requests has been responded.

This commit is contained in:
Tatsuhiro Tsujikawa 2012-05-11 00:23:52 +09:00
parent aba18f4ba7
commit b0761a3eba
1 changed files with 5 additions and 2 deletions

View File

@ -308,8 +308,11 @@ int communicate(const std::string& host, uint16_t port,
return -1; return -1;
} }
if(pollfds[0].revents & (POLLIN | POLLOUT)) { if(pollfds[0].revents & (POLLIN | POLLOUT)) {
if(sc.recv() != 0 || sc.send() != 0) { int rv;
std::cout << "Fatal" << std::endl; if((rv = sc.recv()) != 0 || (rv = sc.send()) != 0) {
if(rv != SPDYLAY_ERR_EOF || complete != numreq) {
std::cout << "Fatal: " << spdylay_strerror(rv) << std::endl;
}
ok = false; ok = false;
break; break;
} }