Refactor flush/1 function to prevent DoS attack
Refactor flush/1 function to prevent DoS attack

When Yaws receives a request with the method 'GET', 'HEAD', 'OPTIONS'..., its
content is ignored. Because the connection may be persistent, we must flush
the socket.

Today, this is done by reading all the data at one time. If there is an huge
amount of data, Erlang can run out of memory. To fix this issue, we flush
data by blocks of maximum 'partial_post_size' bytes.

There is another problem with the current implementation of the flush/1
function. It does not handle chunked encoded requests. So, now, we also
catch this case.

jgrinstead/yaws,jgrinstead/yaws,jgrinstead/yaws,jgrinstead/yaws,jgrinstead/yaws,jgrinstead/yaws,jgrinstead/yaws