/[Apache-SVN]
ViewVC logotype

Revision 1915271


Jump to revision: Previous Next
Author: ylavic
Date: Tue Jan 16 17:40:36 2024 UTC (5 months, 1 week ago)
Changed paths: 2
Log Message:
mod_headers: Avoid infinite recursion with the edit* action and empty matches.

Change the recursion used for edit* to a loop using the new ap_regexec_ex()
function taking the current position (offset) in the subject string.

After an empty match do the same thing as pcre2_substitute() (or Perl's /g),
that is: don't allow for another empty match at the same positition by setting
the AP_REG_NOTEMPTY_ATSTART option. If there is a non-empty match use it,
otherwise skip/consume the first character and continue from there.

* modules/metadata/mod_headers.c:
  Rename the hdr_edit_r enum for edit* to hdr_edit_all to better express what
  is does (and since the action is not recursive anymore).

* modules/metadata/mod_headers.c(push_string, push_match):
  New helpers to consume the subject and substitutions in an array of iovec.

* modules/metadata/mod_headers.c(process_regexp):
  Implement the new logic, using push_match() and push_string() to fill the
  iovec array finally passed to apr_strcatv() for the resulting string.



Changed paths

Path Details
Directoryhttpd/httpd/trunk/changes-entries/mod_headers-edit_all.txt added
Directoryhttpd/httpd/trunk/modules/metadata/mod_headers.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26