mirror of
https://github.com/apache/httpd.git
synced 2025-12-17 01:42:26 +03:00
disk_cache: improve logging of errors around reading stored headers
-- add RV and print cache filename from caller. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1721210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
15
modules/cache/mod_cache_disk.c
vendored
15
modules/cache/mod_cache_disk.c
vendored
@@ -786,7 +786,7 @@ static apr_status_t read_table(cache_handle_t *handle, request_rec *r,
|
|||||||
/* ### What about APR_EOF? */
|
/* ### What about APR_EOF? */
|
||||||
rv = apr_file_gets(w, MAX_STRING_LEN - 1, file);
|
rv = apr_file_gets(w, MAX_STRING_LEN - 1, file);
|
||||||
if (rv != APR_SUCCESS) {
|
if (rv != APR_SUCCESS) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00717)
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00717)
|
||||||
"Premature end of cache headers.");
|
"Premature end of cache headers.");
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@@ -865,6 +865,7 @@ static apr_status_t read_table(cache_handle_t *handle, request_rec *r,
|
|||||||
static apr_status_t recall_headers(cache_handle_t *h, request_rec *r)
|
static apr_status_t recall_headers(cache_handle_t *h, request_rec *r)
|
||||||
{
|
{
|
||||||
disk_cache_object_t *dobj = (disk_cache_object_t *) h->cache_obj->vobj;
|
disk_cache_object_t *dobj = (disk_cache_object_t *) h->cache_obj->vobj;
|
||||||
|
apr_status_t rv;
|
||||||
|
|
||||||
/* This case should not happen... */
|
/* This case should not happen... */
|
||||||
if (!dobj->hdrs.fd) {
|
if (!dobj->hdrs.fd) {
|
||||||
@@ -877,8 +878,16 @@ static apr_status_t recall_headers(cache_handle_t *h, request_rec *r)
|
|||||||
h->resp_hdrs = apr_table_make(r->pool, 20);
|
h->resp_hdrs = apr_table_make(r->pool, 20);
|
||||||
|
|
||||||
/* Call routine to read the header lines/status line */
|
/* Call routine to read the header lines/status line */
|
||||||
read_table(h, r, h->resp_hdrs, dobj->hdrs.fd);
|
rv = read_table(h, r, h->resp_hdrs, dobj->hdrs.fd);
|
||||||
read_table(h, r, h->req_hdrs, dobj->hdrs.fd);
|
if (rv != APR_SUCCESS) {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
|
"Error reading response headers from %s for %s", dobj->hdrs.file, dobj->name);
|
||||||
|
}
|
||||||
|
rv = read_table(h, r, h->req_hdrs, dobj->hdrs.fd);
|
||||||
|
if (rv != APR_SUCCESS) {
|
||||||
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||||
|
"Error reading request headers from %s for %s", dobj->hdrs.file, dobj->name);
|
||||||
|
}
|
||||||
|
|
||||||
apr_file_close(dobj->hdrs.fd);
|
apr_file_close(dobj->hdrs.fd);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user