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

Method onBody

github-actions/browserstack/set-browserstack-env.js:6359–6381  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

6357 }
6358 if (statusCode < 200) {
6359 return 1;
6360 }
6361 if (socket[kBlocking]) {
6362 socket[kBlocking] = false;
6363 client[kResume]();
6364 }
6365 return pause ? constants3.ERROR.PAUSED : 0;
6366 }
6367 onBody(buf) {
6368 const { client, socket, statusCode, maxResponseSize } = this;
6369 if (socket.destroyed) {
6370 return -1;
6371 }
6372 const request = client[kQueue][client[kRunningIdx]];
6373 assert(request);
6374 assert(this.timeoutType === TIMEOUT_BODY);
6375 if (this.timeout) {
6376 if (this.timeout.refresh) {
6377 this.timeout.refresh();
6378 }
6379 }
6380 assert(statusCode >= 200);
6381 if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
6382 util.destroy(socket, new ResponseExceededMaxSizeError());
6383 return -1;
6384 }

Callers 1

lazyllhttpFunction · 0.45

Calls 3

refreshMethod · 0.45
destroyMethod · 0.45
onDataMethod · 0.45

Tested by

no test coverage detected