Working clock stream. Propagate up write errors

This commit is contained in:
Ian Gulliver
2019-04-29 00:11:07 +00:00
parent 4d4525b145
commit 205b8253b2
11 changed files with 92 additions and 13 deletions

View File

@@ -22,12 +22,12 @@ FastCGIConn::~FastCGIConn() {
LOG(INFO) << "connection closed (handled " << requests_ << " requests)";
}
void FastCGIConn::Write(const std::vector<iovec>& vecs) {
bool FastCGIConn::Write(const std::vector<iovec>& vecs) {
size_t total_size = 0;
for (const auto& vec : vecs) {
total_size += vec.iov_len;
}
CHECK_EQ(writev(sock_, vecs.data(), vecs.size()), total_size);
return writev(sock_, vecs.data(), vecs.size()) == total_size;
}
void FastCGIConn::Serve() {