http: unify smart discarding in a function
http: let it parse no headers request properly
http: fix chunk sending
http: support function and io streaming