summaryrefslogtreecommitdiff
path: root/lib/http.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-02-25 09:06:44 -0800
committerisaacs <i@izs.me>2013-02-25 09:06:46 -0800
commitb0e7dbf2c0bab37018e64d14d176d0236c11cd87 (patch)
tree8dab2ceb0f57a4255cb1f63824bb623ec982f92d /lib/http.js
parentf9a0140ef140d89fed1a194c410cd69ed9990305 (diff)
downloadandroid-node-v8-b0e7dbf2c0bab37018e64d14d176d0236c11cd87.tar.gz
android-node-v8-b0e7dbf2c0bab37018e64d14d176d0236c11cd87.tar.bz2
android-node-v8-b0e7dbf2c0bab37018e64d14d176d0236c11cd87.zip
http: Do not free the wrong parser on socket close
This appears to fix #4673. That bug is very hard to reproduce, so it's hard to tell for certain, but this approach is more correct anyway. Hat-tip: @dougwilson
Diffstat (limited to 'lib/http.js')
-rw-r--r--lib/http.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/http.js b/lib/http.js
index 0081432488..212b8becb9 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -1788,7 +1788,8 @@ function connectionListener(socket) {
function serverSocketCloseListener() {
debug('server socket close');
// mark this parser as reusable
- freeParser(parser);
+ if (this.parser)
+ freeParser(this.parser);
abortIncoming();
}