| 526 | } |
| 527 | |
| 528 | onChildOutput(text, which) { |
| 529 | if (which !== 'stderr') { return; } |
| 530 | debug('child stderr: %j', text); |
| 531 | |
| 532 | this.childStderr += text; |
| 533 | |
| 534 | const combined = this.disconnectSentinelBuffer + text; |
| 535 | // Detect the disconnect sentinel. |
| 536 | if (this.connected && |
| 537 | StringPrototypeIncludes(combined, kProbeDisconnectSentinel)) { |
| 538 | debug('disconnect sentinel detected, resetting client'); |
| 539 | this.disconnectRequested = true; |
| 540 | this.client.reset(); |
| 541 | } |
| 542 | |
| 543 | if (combined.length > kProbeDisconnectSentinel.length) { // Slide the buffer. |
| 544 | this.disconnectSentinelBuffer = StringPrototypeSlice(combined, |
| 545 | combined.length - kProbeDisconnectSentinel.length); |
| 546 | } else { |
| 547 | this.disconnectSentinelBuffer = combined; |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | onChildExit(code, signal) { |
| 552 | debug('child exit: code=%s signal=%s connected=%s started=%s finished=%s inFlight=%j', |