http: Return true on empty writes, not false
authorisaacs <i@izs.me>
Thu, 23 May 2013 22:12:13 +0000 (15:12 -0700)
committerisaacs <i@izs.me>
Thu, 23 May 2013 22:21:17 +0000 (15:21 -0700)
commita2f93cf77a8121db713bb003e26031bcca446f1f
treea0825b2b4a61d108106f89367878b92e6be71c73
parente2385839d7bde937334e34da082293cae877fe2f
http: Return true on empty writes, not false

Otherwise, writing an empty string causes the whole program to grind to
a halt when piping data into http messages.

This wasn't as much of a problem (though it WAS a bug) in 0.8 and
before, because our hyperactive 'drain' behavior would mean that some
*previous* write() would probably have a pending drain event, and cause
things to start moving again.
lib/http.js
test/simple/test-http-zero-length-write.js [new file with mode: 0644]