Commit 59dcfc1f authored by Tristan Rice's avatar Tristan Rice Committed by Facebook GitHub Bot

Back out "Remove setZeroCopy() override"

Summary:
Original commit changeset: ec402ad2badb

reverting D27044720 (https://github.com/facebook/folly/commit/bda140dc1f4be1846a19e708b7c2a0aa6215c730) to S225748

This check was added in D22272411 (https://github.com/facebook/folly/commit/0ff36eaf684ee7c1eeac0e4592e47c92f2440323) as a fix for S204433. This is very likely the cause for S225748 since the behavior is very similar to the original sev

Reviewed By: clrfb

Differential Revision: D27166845

fbshipit-source-id: c0a3f44690cd7c0df5d2a67f433419b961922dec
parent 64b3c42b
......@@ -832,6 +832,9 @@ class AsyncSSLSocket : public AsyncSocket {
asyncOperationFinishCallback_ = std::move(cb);
}
// zero copy is not supported by openssl.
bool setZeroCopy(bool /*enable*/) override { return false; }
private:
/**
* Handle the return from invoking SSL_accept
......
......@@ -206,6 +206,20 @@ TEST(AsyncSSLSocketTest, ConnectWriteReadClose) {
EXPECT_EQ(socket->getSSLSocket()->getTotalConnectTimeout().count(), 10000);
}
/**
* Check that zero copy options are a noop under AsyncSSLSocket since they
* aren't supported.
*/
TEST(AsyncSSLSocketTest, ZeroCopy) {
// Set up SSL context.
std::shared_ptr<SSLContext> sslContext(new SSLContext());
sslContext->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
auto socket = AsyncSSLSocket::newSocket(sslContext, /*evb=*/nullptr);
EXPECT_FALSE(socket->setZeroCopy(true));
EXPECT_FALSE(socket->getZeroCopy());
}
/**
* Same as above simple test, but with a large read len to test
* clamping behavior.
......
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