fast_forward_request() did not handle the chunked case. Add logic
to handle the chunked case. In order to handle this, I've borrowed
a concept from civetweb 1.8: setting is_chunked = 2 indicates we've
consumed all the input and should now return EOF.
mg_read() - this logic was inconsistent about return results.
I've modified it to always return 0 on EOF and -1 on error. (NB: EOF
is not 0.) I've also modified it to check and set is_chunked to 2
on reaching end of chunked input.
Fixes: http://tracker.ceph.com/issues/19736
Signed-off-by: Marcus Watts <mwatts@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>