Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Aug 16, 2020
1 parent 9ac9583 commit 6b01995
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,14 @@ class Parser extends HTTPParser {
// not from start.

const ret = request.onBody(chunk, offset, length)
if (ret == null && this.read > client[kMaxAbortedPayload]) {
client[kQueue][client[kRunningIdx]++] = null
this.statusCode = null
util.destroy(socket, new InformationalError('max aborted payload'))
if (ret == null) {
// TODO: Stop more requests from being scheduled, i.e. busy=true
// until requests has either completed or socket is destroyed.
if (this.read > client[kMaxAbortedPayload]) {
client[kQueue][client[kRunningIdx]++] = null
this.statusCode = null
util.destroy(socket, new InformationalError('max aborted payload'))
}
} else if (ret === false) {
socket.pause()
}
Expand All @@ -585,6 +589,7 @@ class Parser extends HTTPParser {
assert(statusCode >= 100)

if (upgrade) {
// TODO: When, how and why does this happen?
assert(statusCode < 300 || request.method === 'CONNECT')
return
}
Expand Down

0 comments on commit 6b01995

Please sign in to comment.