MCPcopy
hub / github.com/di-sukharev/opencommit / end

Method end

out/cli.cjs:55340–55375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55338 if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
55339 if (socket[kParser].timeout.refresh) {
55340 socket[kParser].timeout.refresh();
55341 }
55342 }
55343 }
55344 return ret;
55345 }
55346 end() {
55347 const { socket, contentLength, client, bytesWritten, expectsPayload, header, request: request3 } = this;
55348 request3.onRequestSent();
55349 socket[kWriting] = false;
55350 if (socket[kError]) {
55351 throw socket[kError];
55352 }
55353 if (socket.destroyed) {
55354 return;
55355 }
55356 if (bytesWritten === 0) {
55357 if (expectsPayload) {
55358 socket.write(`${header}content-length: 0\r
55359\r
55360`, "latin1");
55361 } else {
55362 socket.write(`${header}\r
55363`, "latin1");
55364 }
55365 } else if (contentLength === null) {
55366 socket.write("\r\n0\r\n\r\n", "latin1");
55367 }
55368 if (contentLength !== null && bytesWritten !== contentLength) {
55369 if (client[kStrictContentLength]) {
55370 throw new RequestContentLengthMismatchError();
55371 } else {
55372 process.emitWarning(new RequestContentLengthMismatchError());
55373 }
55374 }
55375 if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
55376 if (socket[kParser].timeout.refresh) {
55377 socket[kParser].timeout.refresh();
55378 }

Callers 15

removeFunction · 0.80
writeToStreamFunction · 0.80
destroyStreamFunction · 0.80
getFunction · 0.80
reqFunction · 0.80
checkFinishedFunction · 0.80
formDataFunction · 0.80
writeBodyH2Function · 0.80

Calls 4

resume2Function · 0.85
refreshMethod · 0.80
onRequestSentMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected