Commit 70618258 authored by Subodh Iyengar's avatar Subodh Iyengar Committed by Facebook Github Bot 2

Remove getTFOSucceeded

Summary:
The getTFOsucceeded doesn't really work right now
as intended. Currently we check right after sendmsg,
however we can only know whether or not the server
has acked the data after 1-RTT.

This removes getTFOSucceeded. Will fix in another diff.

Differential Revision: D3679235

fbshipit-source-id: 6b2bb01d3743ea7e68ad3cc9a26be6806f17ffbe
parent cf93e807
......@@ -1770,18 +1770,6 @@ AsyncSocket::sendSocketMessage(int fd, struct msghdr* msg, int msg_flags) {
msg->msg_namelen = len;
totalWritten = tfoSendMsg(fd_, msg, msg_flags);
if (totalWritten >= 0) {
// Call tfo_succeeded to check if TFO was used.
tfoSucceeded_ = detail::tfo_succeeded(fd_);
if (errno != 0) {
auto errnoCopy = errno;
AsyncSocketException ex(
AsyncSocketException::INTERNAL_ERROR,
withAddr("error calling tfo_succeeded"),
errnoCopy);
return WriteResult(
WRITE_ERROR, folly::make_unique<AsyncSocketException>(ex));
}
tfoFinished_ = true;
state_ = StateEnum::ESTABLISHED;
handleInitialReadWrite();
......
......@@ -431,14 +431,6 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
return tfoFinished_;
}
/**
* Returns whether or not TFO "worked", or, succeeded
* in actually being used.
*/
bool getTFOSucceeded() const {
return tfoSucceeded_;
}
// Methods controlling socket options
/**
......@@ -907,7 +899,6 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
bool tfoEnabled_{false};
bool tfoAttempted_{false};
bool tfoFinished_{false};
bool tfoSucceeded_{false};
};
#ifdef _MSC_VER
#pragma vtordisp(pop)
......
......@@ -2408,7 +2408,6 @@ TEST(AsyncSocketTest, ConnectTFO) {
ASSERT_EQ(1, rcb.buffers.size());
ASSERT_EQ(sizeof(buf), rcb.buffers[0].length);
EXPECT_EQ(0, memcmp(rcb.buffers[0].buffer, buf.data(), buf.size()));
EXPECT_EQ(socket->getTFOSucceeded(), socket->getTFOFinished());
}
/**
......@@ -2476,7 +2475,6 @@ TEST(AsyncSocketTest, ConnectWriteAndCloseNowTFO) {
// Loop, although there shouldn't be anything to do.
evb.loop();
EXPECT_EQ(socket->getTFOSucceeded(), socket->getTFOFinished());
CHECK_EQ(ccb.state, STATE_SUCCEEDED);
ASSERT_TRUE(socket->isClosedBySelf());
......@@ -2504,7 +2502,6 @@ TEST(AsyncSocketTest, ConnectAndCloseTFO) {
// Make sure the connection was aborted
CHECK_EQ(ccb.state, STATE_SUCCEEDED);
EXPECT_EQ(socket->getTFOSucceeded(), socket->getTFOFinished());
ASSERT_TRUE(socket->isClosedBySelf());
ASSERT_FALSE(socket->isClosedByPeer());
......@@ -2765,7 +2762,6 @@ TEST(AsyncSocketTest, ConnectTFOWithBigData) {
t.join();
EXPECT_EQ(socket->getTFOSucceeded(), socket->getTFOFinished());
EXPECT_EQ(STATE_SUCCEEDED, write.state);
EXPECT_EQ(0, memcmp(readBuf.data(), sendBuf->data(), readBuf.size()));
EXPECT_EQ(STATE_SUCCEEDED, rcb.state);
......
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