(payload, res, reply)
| 687 | } |
| 688 | |
| 689 | function writePayload (payload, res, reply) { |
| 690 | if (!isHttp2Reply(reply) || Buffer.byteLength(payload) <= HTTP2_WRITE_CHUNK_SIZE) { |
| 691 | res.write(payload) |
| 692 | // then send trailers |
| 693 | sendTrailer(payload, res, reply) |
| 694 | return |
| 695 | } |
| 696 | |
| 697 | writeHttp2Payload(payload, res, () => { |
| 698 | // then send trailers |
| 699 | sendTrailer(payload, res, reply) |
| 700 | }) |
| 701 | } |
| 702 | |
| 703 | function writeHttp2Payload (payload, res, done) { |
| 704 | const buffer = Buffer.isBuffer(payload) ? payload : Buffer.from(payload) |
no test coverage detected