kazuho/mod_reproxy — pull request #7 by tfukaya (2014-07-30 01:59:35+00:00)
Title: support 304 status code

Support 304 HTTP response status (Not Modified).

This PR includes not only case statement for 304 support but bug fix for no response body.
It is recognized EOF as an error doe to the bug.
The bug is happened when a response does not contain Content-Length header nor any bytes of body.
Such response is typically used for 304.

When no Content-Length, "send all data" in rewrite_respone function reads all of remain data until EOF.
If no remain data (or no body), apr_socket_recv returns with APR_EOF.
It breaks while loop, then gets to ON_EXIT label.
In this situation, sent_length is 0 and rv is not APR_SUCCESS but APR_EOF, so mod_reproxy reports it as an error.
But it does not a real error, we set rv to APR_SUCCESS when 0 bytes read.

Please review and merge if acceptable.