Commit 088e9561 authored by Wez's avatar Wez Committed by Commit Bot

Revert "Add FDIO_EVT_PEER_CLOSED to WatchFileDescriptor(WATCH_READ) events."

This reverts commit f130981c.

Reason for revert: Doesn't actually fix anything. >.<

Original change's description:
> Add FDIO_EVT_PEER_CLOSED to WatchFileDescriptor(WATCH_READ) events.
> 
> WatchFileDescriptor(WATCH_READ) should result in
> OnFileCanReadWithoutBlocking() if the descriptor is at end-of-stream
> when it is invoked, to wake the caller to detect that by attempting to
> read and receiving zero bytes.
> 
> Bug: 898938, 706592, 884299
> Change-Id: I77662fe77eb8fb988089640a75a60d470770b78f
> Reviewed-on: https://chromium-review.googlesource.com/c/1316672
> Commit-Queue: Wez <wez@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#605154}

TBR=wez@chromium.org,sergeyu@chromium.org,fdegans@chromium.org

Change-Id: I1a98ece4b90de54c2c789dee64c226eb92bcda38
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 898938, 706592, 884299
Reviewed-on: https://chromium-review.googlesource.com/c/1316675Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605157}
parent 9171aefc
...@@ -125,7 +125,7 @@ void MessagePumpFuchsia::FdWatchController::OnZxHandleSignalled( ...@@ -125,7 +125,7 @@ void MessagePumpFuchsia::FdWatchController::OnZxHandleSignalled(
bool* was_stopped = was_stopped_; bool* was_stopped = was_stopped_;
if (events & FDIO_EVT_WRITABLE) if (events & FDIO_EVT_WRITABLE)
watcher_->OnFileCanWriteWithoutBlocking(fd_); watcher_->OnFileCanWriteWithoutBlocking(fd_);
if (!*was_stopped && (events & (FDIO_EVT_READABLE | FDIO_EVT_PEER_CLOSED))) if (!*was_stopped && (events & FDIO_EVT_READABLE))
watcher_->OnFileCanReadWithoutBlocking(fd_); watcher_->OnFileCanReadWithoutBlocking(fd_);
// Don't add additional work here without checking |*was_stopped_| again. // Don't add additional work here without checking |*was_stopped_| again.
...@@ -192,14 +192,13 @@ bool MessagePumpFuchsia::WatchFileDescriptor(int fd, ...@@ -192,14 +192,13 @@ bool MessagePumpFuchsia::WatchFileDescriptor(int fd,
switch (mode) { switch (mode) {
case WATCH_READ: case WATCH_READ:
controller->desired_events_ = FDIO_EVT_READABLE | FDIO_EVT_PEER_CLOSED; controller->desired_events_ = FDIO_EVT_READABLE;
break; break;
case WATCH_WRITE: case WATCH_WRITE:
controller->desired_events_ = FDIO_EVT_WRITABLE; controller->desired_events_ = FDIO_EVT_WRITABLE;
break; break;
case WATCH_READ_WRITE: case WATCH_READ_WRITE:
controller->desired_events_ = controller->desired_events_ = FDIO_EVT_READABLE | FDIO_EVT_WRITABLE;
FDIO_EVT_READABLE | FDIO_EVT_PEER_CLOSED | FDIO_EVT_WRITABLE;
break; break;
default: default:
NOTREACHED() << "unexpected mode: " << mode; NOTREACHED() << "unexpected mode: " << mode;
......
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