(buf)
| 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 | } |
no test coverage detected