libchromeos: Add the ability to cancel pending async stream reads/writes
In order to implement request-response mechanism on socket streams,
it is necessary to cancel pending asynchronous reads in case something
like TLS re-negotiations need to happen.
Added Stream::CancelPendingAsyncOperations that would cancel any pending
asynchronous reads and/or writes and resets all file descriptor watchers
and related facilities on concrete stream implementations.
BUG=brillo:458
TEST=`FEATURES=test emerge-link libchromeos`
Change-Id: I0f9eb1c9cb9ad6b6195c55c148e21264eddf7014
Reviewed-on: https://chromium-review.googlesource.com/271591
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
9 files changed