MCPcopy
hub / github.com/fastify/fastify / writePayload

Function writePayload

lib/reply.js:689–701  ·  view source on GitHub ↗
(payload, res, reply)

Source from the content-addressed store, hash-verified

687}
688
689function 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
703function writeHttp2Payload (payload, res, done) {
704 const buffer = Buffer.isBuffer(payload) ? payload : Buffer.from(payload)

Callers 1

onSendEndFunction · 0.85

Calls 4

isHttp2ReplyFunction · 0.85
sendTrailerFunction · 0.85
writeHttp2PayloadFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected