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

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