From: Felix Geisendörfer Date: Sat, 14 May 2011 14:06:32 +0000 (+0200) Subject: Update http.ServerRequest docs X-Git-Tag: v0.4.8~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d717f6bef74a1c555f891961faf0f32fd3cf82c;p=platform%2Fupstream%2Fnodejs.git Update http.ServerRequest docs The documentation for 'end' was wrong, and 'close' now has an `err` parameter. --- diff --git a/doc/api/http.markdown b/doc/api/http.markdown index e16d384..f8da151 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -142,9 +142,29 @@ body chunk is a string. The body encoding is set with `function () { }` -Emitted exactly once for each message. No arguments. After -emitted no other events will be emitted on the request. +Emitted exactly once for each request. After that, no more `'data'` events +will be emitted on the request. +### Event: 'close' + +`function (err) { }` + +Indicates that the underlaying connection was terminated before +`response.end()` was called or able to flush. + +The `err` parameter is always present and indicates the reason for the timeout: + +`err.code === 'timeout'` indicates that the underlaying connection timed out. +This may happen because all incoming connections have a default timeout of 2 +minutes. + +`err.code === 'aborted'` means that the client has closed the underlaying +connection prematurely. + +Just like `'end'`, this event occurs only once per request, and no more `'data'` +events will fire afterwards. + +Note: `'close'` can fire after `'end'`, but not vice versa. ### request.method