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

Function resumeH1

github-actions/browserstack/set-browserstack-env.js:6584–6631  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

6582 (_b = (_a = socket[kIdleSocketValidationTimeout]).unref) == null ? void 0 : _b.call(_a);
6583 }
6584 function resumeH1(client) {
6585 const socket = client[kSocket];
6586 if (socket && !socket.destroyed) {
6587 if (client[kSize] === 0) {
6588 if (!socket[kNoRef] && socket.unref) {
6589 socket.unref();
6590 socket[kNoRef] = true;
6591 }
6592 } else if (socket[kNoRef] && socket.ref) {
6593 socket.ref();
6594 socket[kNoRef] = false;
6595 }
6596 if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {
6597 if (socket[kIdleSocketValidation] === 0) {
6598 scheduleIdleSocketValidation(client, socket);
6599 socket[kParser].readMore();
6600 if (socket.destroyed) {
6601 return;
6602 }
6603 return;
6604 }
6605 if (socket[kIdleSocketValidation] === 1) {
6606 socket[kParser].readMore();
6607 if (socket.destroyed) {
6608 return;
6609 }
6610 return;
6611 }
6612 }
6613 if (client[kRunning] === 0) {
6614 socket[kParser].readMore();
6615 if (socket.destroyed) {
6616 return;
6617 }
6618 }
6619 if (client[kSize] === 0) {
6620 if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {
6621 socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE);
6622 }
6623 } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
6624 if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
6625 const request = client[kQueue][client[kRunningIdx]];
6626 const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout];
6627 socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS);
6628 }
6629 }
6630 }
6631 }
6632 function shouldSendContentLength(method) {
6633 return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
6634 }

Callers 1

resumeFunction · 0.70

Calls 3

readMoreMethod · 0.45
setTimeoutMethod · 0.45

Tested by

no test coverage detected