You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <gr...@dsn.ericsson.se> on 1999/04/28 14:22:04 UTC

[PATCH] mod_proxy: segfault fix (PR#3178), error message cleanup

Hi all,

The attached patch fixes a segfault in the mod_proxy code, and cleans up
a number of inconsistent error messages that the proxy was writing to
the error log files.

If mod_proxy tried to retrieve a file via a reverse proxy that was
marked as being non-cachable, and that transfer failed,
ap_proxy_cache_error() would try to close and delete the temporary
cached file. Trouble is because no caching was supposed to have been
done, both the filepointer and the temp filename were NULL, resulting in
the segfault. This fix extends the fix suggested in PR#3178. That fix
stopped the segfault on the filepointer, but not on the unlink of the
temporary file afterwards. This fix fixes both problems.

Related to the above patch, a number of error messages were fixed. The
ap_proxy_cache_error() routine added an error message with the text
"Error writing cache file <tempfile>", which in many cases were not
appropriate. For example if an error occured transferring a file from a
website to the reverse proxy the error reported would be
"(131)Connection reset by peer: proxy: error writing to cache file
<tempfile>" instead of "(131)Connection reset by peer: proxy: error
reading from <url>".

A further error message was fixed where the error "<random error>:
ap_bgets() - proxy receive - Error reading from remote server <server>"
was being reported in the case where the remote server responded with a
zero length body.

The patch was created from the apache_1.3.6 tree, but applies cleanly to
the CVS snapshot apache-1.3_19990428071215.

Add to src/CHANGES:

2a3,10
>   *) Fix intermittent SEGV in ap_proxy_cache_error() in 
>      src/modules/proxy_util.c where a NULL filepointer and temporary
>      filename were closed and unlinked. [Graham Leggett <mi...@sharp.fm>]
>      PR#3178
> 
>   *) Fix inconsistant error messages reported by mod_proxy
>      [Graham Leggett <mi...@sharp.fm>]
> 

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight...