Open xiyanxiyan10 opened 8 years ago
Oh! I fixed by
765 if (_parser._keys.size() == 1) {
766 return _cache.get(_parser._keys[0]).then([&out] (auto item) -> future<> {
//@TODO null ptr need check here
767 //scattered_message<char> msg;
768 //this_type::append_item<WithVersion>(msg, std::move(item));
769 //msg.append_static(msg_end);
770
771 std::experimental::string_view key = item->key();
772 out.write(key.data(), key.size());
773
774 // std::experimental::string_view key = item->key();
775 // out.write(key.data(), key.size());
776
777 std::experimental::string_view value = item->value();
778 out.write(value.data(), value.size());
779
780 return make_ready_future<>();
781 });
output_stream does support writing scattered message. It doesn't support mixing scattered with not scattered. It used to be the case that the scope of mixing was limited to flush() boundary and because we flushed after each handler, some handlers could use scattering, and some not, without violating the no mixing rule. But I can see that flush batching relaxed those boundaries since it no longer clears _end
.
I can see the following options:
@avikivity @gleb-cloudius
./core/iostream-impl.hh:60: future<> output_stream::write(net::packet) [with CharType = char]: Assertion `!_end && "Mixing buffered writes and zero-copy writes not supported yet"' failed.
send msg here
but error here