Skip to content

request.abort() should clear timeoutTimer #256

@alexguan

Description

@alexguan

When sending request to a slow server with a short timeout value, before the server returns back anything, calling request.abort does not clear timeoutTimer. The ETIMEDOUT error will still be reported.

e.g.

var r = request.get('http://slowserver', request.defaults({ timeout : 10000 } ));

r.on('error', function (error) {
  //We should not see ETIMEDOUT error here
  console.log(error);
});

r.pipe(...);

process.nextTick(function () {
  r.abort();
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions