MCPcopy Index your code
hub / github.com/nodejs/node / writeBodyH2

Function writeBodyH2

deps/undici/undici.js:9228–9303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9226 }
9227 __name(onTrailers, "onTrailers");
9228 function writeBodyH2() {
9229 const stream = this;
9230 const state = stream[kRequestStreamState];
9231 const { abort, body, client, contentLength, expectsPayload, request } = state;
9232 if (!body || contentLength === 0) {
9233 writeBuffer(
9234 abort,
9235 stream,
9236 null,
9237 client,
9238 request,
9239 client[kSocket],
9240 contentLength,
9241 expectsPayload
9242 );
9243 } else if (util.isBuffer(body)) {
9244 writeBuffer(
9245 abort,
9246 stream,
9247 body,
9248 client,
9249 request,
9250 client[kSocket],
9251 contentLength,
9252 expectsPayload
9253 );
9254 } else if (util.isBlobLike(body)) {
9255 if (typeof body.stream === "function") {
9256 writeIterable(
9257 abort,
9258 stream,
9259 body.stream(),
9260 client,
9261 request,
9262 client[kSocket],
9263 contentLength,
9264 expectsPayload
9265 );
9266 } else {
9267 writeBlob(
9268 abort,
9269 stream,
9270 body,
9271 client,
9272 request,
9273 client[kSocket],
9274 contentLength,
9275 expectsPayload
9276 );
9277 }
9278 } else if (util.isStream(body)) {
9279 writeStream(
9280 abort,
9281 client[kSocket],
9282 expectsPayload,
9283 stream,
9284 body,
9285 client,

Callers

nothing calls this directly

Calls 6

writeBufferFunction · 0.70
writeIterableFunction · 0.70
writeBlobFunction · 0.70
writeStreamFunction · 0.70
assertFunction · 0.50
streamMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…