diff options
author | Josh Gao <jmgao@google.com> | 2018-03-19 13:20:29 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-03-21 15:13:07 -0700 |
commit | 4b80850ae52fe0b7006b05518aa04aa623842f0c (patch) | |
tree | 26e724471974c7e3196af13068e1736908e6a95d /socket_test.cpp | |
parent | b3420dccdd978ddeb988a70277c942b615247723 (diff) | |
download | adb-4b80850ae52fe0b7006b05518aa04aa623842f0c.tar.gz |
adb: don't immediately close a socket when write fails.
When we fail to write to a local socket peer, we might still have data
queued up to send to the other side. Defer closing the socket until
we've failed to both read and write.
Bug: http://b/74616284
Test: python test_device.py
Change-Id: Ifc4b8fe95369b4872e475c2ae4ee611dd2d8b9d7
Diffstat (limited to 'socket_test.cpp')
-rw-r--r-- | socket_test.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/socket_test.cpp b/socket_test.cpp index 44d32765..6b400565 100644 --- a/socket_test.cpp +++ b/socket_test.cpp @@ -209,7 +209,6 @@ TEST_F(LocalSocketTest, write_error_when_having_packets) { TerminateThread(thread); } -#if 0 // Ensure that if we fail to write output to an fd, we will still flush data coming from it. TEST_F(LocalSocketTest, flush_after_shutdown) { int head_fd[2]; @@ -248,7 +247,6 @@ TEST_F(LocalSocketTest, flush_after_shutdown) { ASSERT_EQ(GetAdditionalLocalSocketCount(), fdevent_installed_count()); TerminateThread(thread); } -#endif #if defined(__linux__) |