Browse Source

[multiple] do not clear physical.path if finished

do not reset r->physical.path (unneeded) if returning HANDLER_FINISHED

error handler will reset r->physical.path, if necessary
master
Glenn Strauss 9 months ago
parent
commit
ea38287a4c
  1. 2
      src/mod_cml.c
  2. 3
      src/mod_dirlisting.c
  3. 2
      src/mod_indexfile.c
  4. 3
      src/mod_ssi.c
  5. 2
      src/mod_uploadprogress.c
  6. 3
      src/response.c

2
src/mod_cml.c

@ -241,7 +241,6 @@ URIHANDLER_FUNC(mod_cml_power_magnet) {
log_error(r->conf.errh, __FILE__, __LINE__, "cache-hit");
}
/* cache-hit */
buffer_reset(&r->physical.path);
return HANDLER_FINISHED;
case 1:
/* cache miss */
@ -282,7 +281,6 @@ URIHANDLER_FUNC(mod_cml_is_handled) {
log_error(r->conf.errh, __FILE__, __LINE__, "cache-hit");
}
/* cache-hit */
buffer_reset(&r->physical.path);
return HANDLER_FINISHED;
case 1:
if (r->conf.log_request_handling) {

3
src/mod_dirlisting.c

@ -1024,9 +1024,6 @@ URIHANDLER_FUNC(mod_dirlisting_subrequest) {
r->http_status = 403;
}
buffer_reset(&r->physical.path);
/* not found */
return HANDLER_FINISHED;
}

2
src/mod_indexfile.c

@ -114,7 +114,6 @@ URIHANDLER_FUNC(mod_indexfile_subrequest) {
if (NULL == stat_cache_path_stat(b)) {
if (errno == EACCES) {
r->http_status = 403;
buffer_reset(&r->physical.path);
return HANDLER_FINISHED;
}
@ -125,7 +124,6 @@ URIHANDLER_FUNC(mod_indexfile_subrequest) {
log_perror(r->conf.errh, __FILE__, __LINE__,
"file not found ... or so: %s -> %s",
r->uri.path.ptr, r->physical.path.ptr);
buffer_reset(&r->physical.path);
return HANDLER_FINISHED;
}
continue;

3
src/mod_ssi.c

@ -1220,9 +1220,6 @@ static int mod_ssi_handle_request(request_st * const r, handler_ctx * const p) {
/* Reset the modified time of included files */
include_file_last_mtime = 0;
/* reset physical.path */
buffer_reset(&r->physical.path);
return 0;
}

2
src/mod_uploadprogress.c

@ -258,7 +258,7 @@ URIHANDLER_FUNC(mod_uploadprogress_uri_handler) {
return HANDLER_GO_ON;
case HTTP_METHOD_GET:
buffer_reset(&r->physical.path);
buffer_clear(&r->physical.path);
r->resp_body_started = 1;
r->resp_body_finished = 1;

3
src/response.c

@ -191,7 +191,6 @@ http_response_physical_path_error (request_st * const r, const int code, const c
log_error(r->conf.errh, __FILE__, __LINE__,
"URI : %s", r->uri.path.ptr);
}
buffer_reset(&r->physical.path);
return HANDLER_FINISHED;
}
@ -711,10 +710,10 @@ http_response_static_errdoc (request_st * const r)
CONST_BUF_LEN(content_type));
return;
}
buffer_clear(&r->physical.path);
}
/* build default error-page */
buffer_reset(&r->physical.path);
buffer * const b = r->tmp_buf;
buffer_copy_string_len(b, CONST_STR_LEN(
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"

Loading…
Cancel
Save