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