mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
style: fix word spelling ang lint style in comment (#4500)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -305,7 +305,7 @@ module.exports = function httpAdapter(config) {
|
|||||||
|
|
||||||
// make sure the content length is not over the maxContentLength if specified
|
// make sure the content length is not over the maxContentLength if specified
|
||||||
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
||||||
// stream.destoy() emit aborted event before calling reject() on Node.js v16
|
// stream.destroy() emit aborted event before calling reject() on Node.js v16
|
||||||
rejected = true;
|
rejected = true;
|
||||||
stream.destroy();
|
stream.destroy();
|
||||||
reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
||||||
@@ -381,7 +381,7 @@ module.exports = function httpAdapter(config) {
|
|||||||
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
||||||
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
||||||
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
|
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
|
||||||
// And then these socket which be hang up will devoring CPU little by little.
|
// And then these socket which be hang up will devouring CPU little by little.
|
||||||
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
||||||
req.setTimeout(timeout, function handleRequestTimeout() {
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
||||||
req.abort();
|
req.abort();
|
||||||
|
|||||||
Reference in New Issue
Block a user