Commit 8cb1983
committed
http: actively read and discard response data on every 'readable' event.
Per Node documentation, any response (http.IncomingMessage -> stream.Readable)
must be fully consumed. Otherwise, reading data will block, once the internal
buffer is full.
Effectively this caused http targets with a large enough response body to
always run until the configured timeout is reached.
This also causes the 'end' event not to fire.
References:
- https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_buffering:
"Once the total size of the internal read buffer reaches the threshold
specified by highWaterMark, the stream will temporarily stop reading data
from the underlying resource until the data currently buffered can be
consumed"
- https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_event_end:
"The 'end' event will not be emitted unless the data is completely consumed."
Fixes wmnnd#11.1 parent 8d09cb4 commit 8cb1983
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
0 commit comments