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

Method end

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

Source from the content-addressed store, hash-verified

6993 if (contentLength === null) {
6994 socket.write(`\r
6995${len.toString(16)}\r
6996`, "latin1");
6997 }
6998 this.bytesWritten += len;
6999 const ret = socket.write(chunk);
7000 socket.uncork();
7001 request.onBodySent(chunk);
7002 if (!ret) {
7003 if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
7004 if (socket[kParser].timeout.refresh) {
7005 socket[kParser].timeout.refresh();
7006 }
7007 }
7008 }
7009 return ret;
7010 }
7011 end() {
7012 const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this;
7013 request.onRequestSent();
7014 socket[kWriting] = false;
7015 if (socket[kError]) {
7016 throw socket[kError];
7017 }
7018 if (socket.destroyed) {
7019 return;
7020 }
7021 if (bytesWritten === 0) {
7022 if (expectsPayload) {
7023 socket.write(`${header}content-length: 0\r
7024\r
7025`, "latin1");
7026 } else {
7027 socket.write(`${header}\r
7028`, "latin1");
7029 }
7030 } else if (contentLength === null) {
7031 socket.write("\r\n0\r\n\r\n", "latin1");
7032 }
7033 if (contentLength !== null && bytesWritten !== contentLength) {

Callers 10

""Function · 0.45
_finalMethod · 0.45
onFinishedFunction · 0.45
writeIterableFunction · 0.45
writeBufferFunction · 0.45
writeBlobFunction · 0.45
onCompleteMethod · 0.45
packageDataFunction · 0.45
execMethod · 0.45
getExecOutputFunction · 0.45

Calls 3

onRequestSentMethod · 0.45
writeMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected