Commit Graph

28 Commits

Author SHA1 Message Date
ec8855dcfd Follow up to r1824339: s/strcasecmp/ap_cstr_casecmp/ as suggested by Ruediger.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824439 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 10:01:13 +00:00
2c21956d95 regex: Allow to configure global/default options for regexes.
Like caseless matching or extended format, which may be useful as default
behaviour the whole configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824339 13f79535-47bb-0310-9956-ffa450edef68
2018-02-15 17:53:24 +00:00
08ddf7ad0a ap_expr: open string expressions to the <word>.
Introduces the syntax "%{:<word>:}", borrowed from the <var>'s one, and which
likewise can be embedded anywhere in a string expression (the same reserved
character ':' gets reused in an unambiguous manner).

This allows the two types of expressions (boolean and string) to now share
fully the same language set, namely: strings, lists, vars, regexes, backrefs,
functions with multiple or complex arguments, and especially combinations
thereof.

Most of them were reserved to boolean expressions only, while complex string
constructions can also benefit to, well, strings. The <word> construct allows
that (say the syntax "%{:<word>:}" looks like a temporary variable constructed
in a string).

Since string expressions may now have to deal with lists (arrays), they also
need a way to produce/extract strings from list and vice versa. This can be
done with the new "join" and "split" operators, while the new substitution
regexes (like "s/<pattern>/<substitute>/<flags>") may be used to manipulate
strings in place. All this of course available for both string and boolean
expressions.

Tests and doc updates upcoming..



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1810605 13f79535-47bb-0310-9956-ffa450edef68
2017-10-02 21:57:26 +00:00
cdc1d3a938 With the changes of api from pcre 8.x to 10.x, do not presume that the internal
ovector will be created to accept greater than nmatch elements for processing.
Allocate enough elts in all circumstances for pcre2api.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773882 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 21:57:06 +00:00
12cfcf08ff Replace PCRE with PCRE2 where it is available.
This patch removes the needless assignment of re_erroffset in the conf pool
by the worker threads; such mistakes break the shared copy-on-write pages of
memory that should have remained common between all httpd worker processes.

Two de-optimizations are inherent in this patch, the former ovector-on-stack
opportunity is lost unless implemented as a new general context. Safer that
we either create a new general context using pool allocation, or recycle a
per pool or per thread match_data buffer of some arbitrary 10 elts or so.

Submitted by: wrowe, Petr Pisar <ppisar@redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773454 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 19:06:06 +00:00
700dd72569 Re-introduce check for sufficient PCRE version.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612945 13f79535-47bb-0310-9956-ffa450edef68
2014-07-23 21:15:06 +00:00
8e18f1a5e9 Add compiled and loaded PCRE version numbers
to "httpd -V" output and to mod_info page.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612934 13f79535-47bb-0310-9956-ffa450edef68
2014-07-23 19:53:22 +00:00
165f9ffcdd Check for correct minimum PCRE version in configure,
do not check in source code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612921 13f79535-47bb-0310-9956-ffa450edef68
2014-07-23 19:01:45 +00:00
0d2710e0d5 Clarify comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612653 13f79535-47bb-0310-9956-ffa450edef68
2014-07-22 19:29:08 +00:00
8feaa1f1e3 And use #error if we get past configure...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1579267 13f79535-47bb-0310-9956-ffa450edef68
2014-03-19 15:45:42 +00:00
fea24799cf * Only use PCRE_DUPNAMES if it is present (only in more recent versions of PCRE)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564439 13f79535-47bb-0310-9956-ffa450edef68
2014-02-04 19:39:18 +00:00
4fecd089c4 Add a "MATCH_" prefix to variables set within
LocationMatch/DirectoryMatch/FilesMatch.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555266 13f79535-47bb-0310-9956-ffa450edef68
2014-01-03 22:26:55 +00:00
43e022f007 core: Support named groups and backreferences within the LocationMatch,
DirectoryMatch, FilesMatch and ProxyMatch directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554300 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 19:50:52 +00:00
a1b0be3dcb Make ap_regcomp() return AP_REG_ESPACE if out of memory. Make ap_pregcomp()
abort if out of memory.

This raises the minimum PCRE requirement to version 6.0, released in 2005.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1343109 13f79535-47bb-0310-9956-ffa450edef68
2012-05-27 21:40:00 +00:00
0415804814 BZ 52623: Fix building against PCRE 8.30.
PCRE dropped support for pcre_info() which is
deprecated since a long time. Use pcre_fullinfo()
instead, which exists since version 3.0 of PCRE.

Patch provided by Ruediger Pluem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1243176 13f79535-47bb-0310-9956-ffa450edef68
2012-02-11 22:45:37 +00:00
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
5a225df5a3 Change the indentation to resemble the rest of the project. No code change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1125816 13f79535-47bb-0310-9956-ffa450edef68
2011-05-21 20:55:46 +00:00
63366c900b Add ap_regexec_len() function that works with non-null-terminated
strings.

PR: 51231
Submitted by: Yehezkel Horowitz <horowity checkpoint com>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1125802 13f79535-47bb-0310-9956-ffa450edef68
2011-05-21 20:34:05 +00:00
083e4c6925 * server/util_pcre.c (ap_regerror): Use passed-in buffer size rather
than the size of a pointer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1095448 13f79535-47bb-0310-9956-ffa450edef68
2011-04-20 16:17:44 +00:00
d4963eadb1 Introduce ap_rxplus class: higher-level regexps supporting perl-style
regexp operations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999533 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 18:42:20 +00:00
02dc2d45cf Code cleanup: replace strncpy by apr_cpystrn or apr_pstrmemdup
Submitted by: Takashi Sato <takashi lans tv com>
PR: 43432


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@981086 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 20:08:44 +00:00
34487c8eb9 revert last change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395421 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 22:52:45 +00:00
ebe24d48c7 Update the last year of copyright.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395229 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:23:42 +00:00
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
7754d8254f * server/util_pcre.c (ap_regexec): Fix --with-pcre build with older
versions of pcre.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@227189 13f79535-47bb-0310-9956-ffa450edef68
2005-08-03 09:45:57 +00:00
e681eb22c8 Get httpd-2.1 building once again on win32.
NEVER NEVER screw around with redeclaring AP_ macros and constants.
  If the compiler won't pick them up, e.g., AP_DECLARE, ya've done 
  something wrong from the start.

  All httpd/ap headers depend on httpd.h - plain and simple, so this
  un-convolutes the unusual order here.

  STATIC has become PCRE_STATIC, along with some other odd definitions.
  The only remaining emit is that _pcre_free export is imported, which
  implies something is unusual with the declaration.  Still researching.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@154207 13f79535-47bb-0310-9956-ffa450edef68
2005-02-17 23:45:16 +00:00
27759dec9a * include/ap_regex.h: Include apr.h not stdlib.h; replace pointless
regoff_t typedef with int; s/size_t/apr_size_t/;.  Comment fixes.

* server/util_pcre.c: s/size_t/apr_size_t/.

* include/httpd.h: Include stdlib.h here instead since many other
files assume it was included by httpd.h at some point.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153407 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 14:57:34 +00:00
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00