Skip to content

Commit 70dd6d4

Browse files
committed
Fix TJ's assert error
Unable to reproduce but connect's "make test TESTS=test/static.test.js" does it occasionally.
1 parent a55a9ff commit 70dd6d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/http.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,11 @@ function connectionListener(socket) {
10891089
// When we're finished writing the response, check if this is the last
10901090
// respose, if so destroy the socket.
10911091
res.on('finish', function() {
1092-
assert(incoming[0] === req);
1092+
// Usually the first incoming element should be our request. it may
1093+
// be that in the case abortIncoming() was called that the incoming
1094+
// array will be empty.
1095+
assert(incoming.length == 0 || incoming[0] === req);
1096+
10931097
incoming.shift();
10941098

10951099
res.detachSocket(socket);

0 commit comments

Comments
 (0)