We still want to "write" empty messages
So that the size of the messages queue can go to zero
This commit is contained in:
@@ -69,17 +69,13 @@ bool Connection::writeBytes() {
|
|||||||
for (auto it = messages_.begin();
|
for (auto it = messages_.begin();
|
||||||
it != messages_.end() && iov_count < IOV_MAX; ++it) {
|
it != messages_.end() && iov_count < IOV_MAX; ++it) {
|
||||||
const auto &msg = *it;
|
const auto &msg = *it;
|
||||||
if (msg.size() > 0) {
|
iov[iov_count] = {
|
||||||
iov[iov_count] = {
|
const_cast<void *>(static_cast<const void *>(msg.data())),
|
||||||
const_cast<void *>(static_cast<const void *>(msg.data())),
|
msg.size()};
|
||||||
msg.size()};
|
iov_count++;
|
||||||
iov_count++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iov_count == 0) {
|
assert(iov_count > 0);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t w;
|
ssize_t w;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|||||||
Reference in New Issue
Block a user