From: Subodh Iyengar Date: Tue, 9 Aug 2016 14:53:04 +0000 (-0700) Subject: Remove getTFOSucceeded X-Git-Tag: v2016.08.15.00~34 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70618258130b18cae08ecd5e88de518ab38425fd;p=folly.git 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 --- diff --git a/folly/io/async/AsyncSocket.cpp b/folly/io/async/AsyncSocket.cpp index f320996f..f8b42a74 100644 --- a/folly/io/async/AsyncSocket.cpp +++ b/folly/io/async/AsyncSocket.cpp @@ -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(ex)); - } - tfoFinished_ = true; state_ = StateEnum::ESTABLISHED; handleInitialReadWrite(); diff --git a/folly/io/async/AsyncSocket.h b/folly/io/async/AsyncSocket.h index 35b3815c..36949725 100644 --- a/folly/io/async/AsyncSocket.h +++ b/folly/io/async/AsyncSocket.h @@ -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) diff --git a/folly/io/async/test/AsyncSocketTest2.cpp b/folly/io/async/test/AsyncSocketTest2.cpp index 95d806db..bd384726 100644 --- a/folly/io/async/test/AsyncSocketTest2.cpp +++ b/folly/io/async/test/AsyncSocketTest2.cpp @@ -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);