| 6772 | } |
| 6773 | function writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) { |
| 6774 | var _a, _b, _c; |
| 6775 | assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); |
| 6776 | let finished = false; |
| 6777 | const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }); |
| 6778 | const onData = function(chunk) { |
| 6779 | if (finished) { |
| 6780 | return; |
| 6781 | } |
| 6782 | try { |
| 6783 | if (!writer.write(chunk) && this.pause) { |
| 6784 | this.pause(); |