Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change .on to .once, remove possible memory leaks #2420

Merged
merged 1 commit into from Oct 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions request.js
Expand Up @@ -893,7 +893,7 @@ Request.prototype.onRequestResponse = function (response) {
}
})

response.on('end', function () {
response.once('end', function () {
self._ended = true
})

Expand Down Expand Up @@ -965,7 +965,7 @@ Request.prototype.onRequestResponse = function (response) {
self._destdata = true
self.emit('data', chunk)
})
responseContent.on('end', function (chunk) {
responseContent.once('end', function (chunk) {
self.emit('end', chunk)
})
responseContent.on('error', function (error) {
Expand Down