Commit 68d54bdd authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

Do not set WriteFlags::WRITE_MSG_ZEROCOPY if the buffer ! isManaged()

Summary: Do not set WriteFlags::WRITE_MSG_ZEROCOPY if the buffer isShared()

Reviewed By: yfeldblum

Differential Revision: D6068711

fbshipit-source-id: fff14dcd4fcb20c9dbb60794420845042518922c
parent 899d83f0
......@@ -861,7 +861,8 @@ bool AsyncSocket::isZeroCopyRequest(WriteFlags flags) {
void AsyncSocket::adjustZeroCopyFlags(
folly::IOBuf* buf,
folly::WriteFlags& flags) {
if (zeroCopyEnabled_ && zeroCopyWriteChainThreshold_ && buf) {
if (zeroCopyEnabled_ && zeroCopyWriteChainThreshold_ && buf &&
buf->isManaged()) {
if (buf->computeChainDataLength() >= zeroCopyWriteChainThreshold_) {
flags |= folly::WriteFlags::WRITE_MSG_ZEROCOPY;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment