From b0761a3eba5851555fe18a9fd9ed69e89f688e33 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 11 May 2012 00:23:52 +0900 Subject: [PATCH] Don't print "Fatal" if EOF is received and all requests has been responded. --- examples/spdycat.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/spdycat.cc b/examples/spdycat.cc index 843a1991..0d1c828e 100644 --- a/examples/spdycat.cc +++ b/examples/spdycat.cc @@ -308,8 +308,11 @@ int communicate(const std::string& host, uint16_t port, return -1; } if(pollfds[0].revents & (POLLIN | POLLOUT)) { - if(sc.recv() != 0 || sc.send() != 0) { - std::cout << "Fatal" << std::endl; + int rv; + 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; break; }