| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -367,6 +367,9 @@ void IOWatcher::Dump() { | |||
| 367 | 367 | DEBUG_PRINT("<%d> got fd to send: %d", io->watcher_.fd, fd_to_send); | |
| 368 | 368 | assert(fd_to_send >= 0); | |
| 369 | 369 | } | |
| 370 | + // Already set this to null. We will readd the fd later if there was | ||
| 371 | + // an error. | ||
| 372 | + bucket->Set(fd_sym, Null()); | ||
| 370 | 373 | } | |
| 371 | 374 | } | |
| 372 | 375 | ||
@@ -410,6 +413,14 @@ void IOWatcher::Dump() { | |||
| 410 | 413 | written); | |
| 411 | 414 | ||
| 412 | 415 | if (written < 0) { | |
| 416 | + | ||
| 417 | + // Some sort of error. Must set the fd_to_send back in the bucket. | ||
| 418 | + if (fd_to_send >= 0) { | ||
| 419 | + Local<Value> bucket_v = watcher->Get(first_bucket_sym); | ||
| 420 | + assert(bucket_v->IsObject()); | ||
| 421 | + bucket_v->ToObject()->Set(fd_sym, Integer::New(fd_to_send)); | ||
| 422 | + } | ||
| 423 | + | ||
| 413 | 424 | // Allow EAGAIN. | |
| 414 | 425 | // TODO: handle EMSGSIZE after sendmsg(). | |
| 415 | 426 | if (errno == EAGAIN) { | |
@@ -471,10 +482,6 @@ void IOWatcher::Dump() { | |||
| 471 | 482 | // serialized onto a buffer. | |
| 472 | 483 | size_t bucket_len = Buffer::Length(data_v->ToObject()); | |
| 473 | 484 | ||
| 474 | - if (unix_socket && bucket->Has(fd_sym)) { | ||
| 475 | - bucket->Set(fd_sym, Null()); | ||
| 476 | - } | ||
| 477 | - | ||
| 478 | 485 | DEBUG_PRINT("<%d,%ld> bucket_len: %ld, offset: %ld", | |
| 479 | 486 | io->watcher_.fd, | |
| 480 | 487 | bucket_index, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments