Error argument for http.ServerRequest 'close'
authorFelix Geisendörfer <felix@debuggable.com>
Sat, 14 May 2011 13:58:41 +0000 (15:58 +0200)
committerRyan Dahl <ry@tinyclouds.org>
Sat, 14 May 2011 21:15:31 +0000 (14:15 -0700)
commite7ac6d8fcd3841da072d8b4b6c328b33549d45c3
treef19601e8bb382bd1667292986210fc10e47deed5
parent1fde5f51b4da77587e2f6ab6087d27d412e12464
Error argument for http.ServerRequest 'close'

Problem: It was not possible to detect the reason for a premature
connection termination in http requests.

This patch provides a new `err` argument to the 'close' event which
can be inspected to differentiate between a timeout and a client
actively terminating the connection.

Also contains tests for this new behavior for http and https.
lib/http.js
test/simple/test-http-request-aborted.js [new file with mode: 0644]
test/simple/test-http-set-timeout.js
test/simple/test-https-request-aborted.js [new file with mode: 0644]
test/simple/test-https-request-timeout.js [new file with mode: 0644]