Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
plugins/timeout: release response timeout on error
Browse files Browse the repository at this point in the history
  • Loading branch information
skenqbx committed Apr 23, 2015
1 parent 4912088 commit c0e52bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/plugins/timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ TimeoutPlugin.prototype._enable = function(call, options, request) {
// TODO: figure out when to actually start the timeout
responseTimeoutId = setTimeout(onResponseTimeout, options.timeout.response);
request.once('response', releaseResponseTimeout);
request.once('error', releaseResponseTimeout);
}
};
2 changes: 1 addition & 1 deletion test/test-http-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ suite('http:timeout', function() {
suiteSetup(function(done) {
rail = new RAIL();
rail.use('timeout', {
response: 500
response: 50
});

server = http.createServer(listener);
Expand Down

0 comments on commit c0e52bc

Please sign in to comment.