Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 } | 317 } |
| 318 | 318 |
| 319 if ((events & EPOLLOUT) != 0) { | 319 if ((events & EPOLLOUT) != 0) { |
| 320 if ((events & EPOLLERR) != 0) { | 320 if ((events & EPOLLERR) != 0) { |
| 321 event_mask = (1 << kErrorEvent); | 321 event_mask = (1 << kErrorEvent); |
| 322 sd->MarkClosedWrite(); | 322 sd->MarkClosedWrite(); |
| 323 } else { | 323 } else { |
| 324 event_mask |= (1 << kOutEvent); | 324 event_mask |= (1 << kOutEvent); |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 | |
| 328 if (events == (EPOLLHUP | EPOLLERR)) { | |
|
Søren Gjesse
2013/02/22 09:29:06
So we still never get EPOLLHUP all alone on socket
Anders Johnsen
2013/02/22 09:33:18
Added.
| |
| 329 event_mask = (1 << kErrorEvent); | |
| 330 sd->MarkClosedWrite(); | |
| 331 sd->MarkClosedRead(); | |
| 332 } | |
| 327 } | 333 } |
| 328 | 334 |
| 329 return event_mask; | 335 return event_mask; |
| 330 } | 336 } |
| 331 | 337 |
| 332 | 338 |
| 333 void EventHandlerImplementation::HandleEvents(struct epoll_event* events, | 339 void EventHandlerImplementation::HandleEvents(struct epoll_event* events, |
| 334 int size) { | 340 int size) { |
| 335 for (int i = 0; i < size; i++) { | 341 for (int i = 0; i < size; i++) { |
| 336 if (events[i].data.ptr != NULL) { | 342 if (events[i].data.ptr != NULL) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 return reinterpret_cast<void*>(fd + 1); | 431 return reinterpret_cast<void*>(fd + 1); |
| 426 } | 432 } |
| 427 | 433 |
| 428 | 434 |
| 429 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 435 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 430 // The hashmap does not support keys with value 0. | 436 // The hashmap does not support keys with value 0. |
| 431 return dart::Utils::WordHash(fd + 1); | 437 return dart::Utils::WordHash(fd + 1); |
| 432 } | 438 } |
| 433 | 439 |
| 434 #endif // defined(TARGET_OS_LINUX) | 440 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |