MCPcopy Create free account
hub / github.com/angular/dev-infra / writeBodyH2

Function writeBodyH2

github-actions/browserstack/set-browserstack-env.js:7405–7477  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7403 client[kPendingIdx] = client[kRunningIdx];
7404 client[kResume]();
7405 });
7406 stream.once("close", () => {
7407 session[kOpenStreams] -= 1;
7408 if (session[kOpenStreams] === 0) {
7409 session.unref();
7410 }
7411 });
7412 stream.once("error", function(err) {
7413 abort(err);
7414 });
7415 stream.once("frameError", (type, code) => {
7416 abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`));
7417 });
7418 return true;
7419 function writeBodyH2() {
7420 if (!body || contentLength === 0) {
7421 writeBuffer(
7422 abort,
7423 stream,
7424 null,
7425 client,
7426 request,
7427 client[kSocket],
7428 contentLength,
7429 expectsPayload
7430 );
7431 } else if (util.isBuffer(body)) {
7432 writeBuffer(
7433 abort,
7434 stream,
7435 body,
7436 client,
7437 request,
7438 client[kSocket],
7439 contentLength,
7440 expectsPayload
7441 );
7442 } else if (util.isBlobLike(body)) {
7443 if (typeof body.stream === "function") {
7444 writeIterable(
7445 abort,
7446 stream,
7447 body.stream(),
7448 client,
7449 request,
7450 client[kSocket],
7451 contentLength,
7452 expectsPayload
7453 );
7454 } else {
7455 writeBlob(
7456 abort,
7457 stream,
7458 body,
7459 client,
7460 request,
7461 client[kSocket],
7462 contentLength,

Callers 1

writeH2Function · 0.70

Calls 5

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

Tested by

no test coverage detected