Skip to content

Commit

Permalink
Fix TJ's assert error
Browse files Browse the repository at this point in the history
Unable to reproduce but connect's "make test TESTS=test/static.test.js" does
it occasionally.
  • Loading branch information
ry committed May 20, 2011
1 parent a55a9ff commit 70dd6d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,11 @@ function connectionListener(socket) {
// When we're finished writing the response, check if this is the last
// respose, if so destroy the socket.
res.on('finish', function() {
assert(incoming[0] === req);
// Usually the first incoming element should be our request. it may
// be that in the case abortIncoming() was called that the incoming
// array will be empty.
assert(incoming.length == 0 || incoming[0] === req);

incoming.shift();

res.detachSocket(socket);
Expand Down

0 comments on commit 70dd6d4

Please sign in to comment.