bug in handling buf if ret is -1
bug in handling buf if ret is -1

erikdejonge/slowhttptest,rodrigoac/slowhttptest,rodrigoac/slowhttptest,michalkoczwara/slowhttptest,drat/slowhttptest,blu3sh3ll/slowhttptest,michalkoczwara/slowhttptest,shekyan/slowhttptest,blu3sh3ll/slowhttptest,shekyan/slowhttptest,drat/slowhttptest,erikdejonge/slowhttptest