@@ -65,15 +65,15 @@ util.inherits(IncomingMessage, Stream.Readable);
65
65
exports . IncomingMessage = IncomingMessage ;
66
66
67
67
68
- IncomingMessage . prototype . setTimeout = function ( msecs , callback ) {
68
+ IncomingMessage . prototype . setTimeout = function setTimeout ( msecs , callback ) {
69
69
if ( callback )
70
70
this . on ( 'timeout' , callback ) ;
71
71
this . socket . setTimeout ( msecs ) ;
72
72
return this ;
73
73
} ;
74
74
75
75
76
- IncomingMessage . prototype . read = function ( n ) {
76
+ IncomingMessage . prototype . read = function read ( n ) {
77
77
if ( ! this . _consuming )
78
78
this . _readableState . readingMore = false ;
79
79
this . _consuming = true ;
@@ -82,7 +82,7 @@ IncomingMessage.prototype.read = function(n) {
82
82
} ;
83
83
84
84
85
- IncomingMessage . prototype . _read = function ( n ) {
85
+ IncomingMessage . prototype . _read = function _read ( n ) {
86
86
// We actually do almost nothing here, because the parserOnBody
87
87
// function fills up our internal buffer directly. However, we
88
88
// do need to unpause the underlying socket so that it flows.
@@ -94,13 +94,14 @@ IncomingMessage.prototype._read = function(n) {
94
94
// It's possible that the socket will be destroyed, and removed from
95
95
// any messages, before ever calling this. In that case, just skip
96
96
// it, since something else is destroying this connection anyway.
97
- IncomingMessage . prototype . destroy = function ( error ) {
97
+ IncomingMessage . prototype . destroy = function destroy ( error ) {
98
98
if ( this . socket )
99
99
this . socket . destroy ( error ) ;
100
100
} ;
101
101
102
102
103
- IncomingMessage . prototype . _addHeaderLines = function ( headers , n ) {
103
+ IncomingMessage . prototype . _addHeaderLines = _addHeaderLines ;
104
+ function _addHeaderLines ( headers , n ) {
104
105
if ( headers && headers . length ) {
105
106
var raw , dest ;
106
107
if ( this . complete ) {
@@ -119,7 +120,7 @@ IncomingMessage.prototype._addHeaderLines = function(headers, n) {
119
120
this . _addHeaderLine ( k , v , dest ) ;
120
121
}
121
122
}
122
- } ;
123
+ }
123
124
124
125
125
126
// Add the given (field, value) pair to the message
@@ -129,7 +130,8 @@ IncomingMessage.prototype._addHeaderLines = function(headers, n) {
129
130
// multiple values this way. If not, we declare the first instance the winner
130
131
// and drop the second. Extended header fields (those beginning with 'x-') are
131
132
// always joined.
132
- IncomingMessage . prototype . _addHeaderLine = function ( field , value , dest ) {
133
+ IncomingMessage . prototype . _addHeaderLine = _addHeaderLine ;
134
+ function _addHeaderLine ( field , value , dest ) {
133
135
field = field . toLowerCase ( ) ;
134
136
switch ( field ) {
135
137
// Array headers:
@@ -176,12 +178,12 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) {
176
178
dest [ field ] = value ;
177
179
}
178
180
}
179
- } ;
181
+ }
180
182
181
183
182
184
// Call this instead of resume() if we want to just
183
185
// dump all the data to /dev/null
184
- IncomingMessage . prototype . _dump = function ( ) {
186
+ IncomingMessage . prototype . _dump = function _dump ( ) {
185
187
if ( ! this . _dumped ) {
186
188
this . _dumped = true ;
187
189
this . resume ( ) ;
0 commit comments