Commit 3703c0b0 by Geoff Simmons

Postpone the idea of supporting partial matching.

The implementation is not trivial, and I'm still not entirely clear
on the use case for Varnish/VCL. We probably will need partial
matching to implement matches against the request body.
parent d84398c4
Pipeline #247 skipped
...@@ -38,7 +38,7 @@ CONTENTS ...@@ -38,7 +38,7 @@ CONTENTS
======== ========
* regex(STRING, BOOL, BOOL, ENUM {ANYCRLF,UNICODE}, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, STRING, BOOL, INT, BOOL, BOOL, BOOL, BOOL, ENUM {CR,LF,CRLF,ANYCRLF,ANY}, BOOL, BOOL, BOOL, BOOL, BOOL, INT, BOOL, BOOL, BOOL, BOOL) * regex(STRING, BOOL, BOOL, ENUM {ANYCRLF,UNICODE}, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, STRING, BOOL, INT, BOOL, BOOL, BOOL, BOOL, ENUM {CR,LF,CRLF,ANYCRLF,ANY}, BOOL, BOOL, BOOL, BOOL, BOOL, INT, BOOL, BOOL, BOOL, BOOL)
* BOOL match(PRIV_CALL, PRIV_TASK, STRING, STRING, BOOL, BOOL, ENUM {ANYCRLF,UNICODE}, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, STRING, BOOL, INT, BOOL, BOOL, BOOL, BOOL, ENUM {CR,LF,CRLF,ANYCRLF,ANY}, BOOL, BOOL, BOOL, BOOL, BOOL, INT, BOOL, BOOL, BOOL, BOOL, INT, INT, INT, BOOL, BOOL, BOOL, BOOL, BOOL, ENUM {HARD,SOFT}, INT) * BOOL match(PRIV_CALL, PRIV_TASK, STRING, STRING, BOOL, BOOL, ENUM {ANYCRLF,UNICODE}, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, BOOL, STRING, BOOL, INT, BOOL, BOOL, BOOL, BOOL, ENUM {CR,LF,CRLF,ANYCRLF,ANY}, BOOL, BOOL, BOOL, BOOL, BOOL, INT, BOOL, BOOL, BOOL, BOOL, INT, INT, INT, BOOL, BOOL, BOOL, BOOL, BOOL, INT)
* STRING backref(PRIV_TASK, INT, STRING) * STRING backref(PRIV_TASK, INT, STRING)
* STRING namedref(PRIV_TASK, STRING, STRING) * STRING namedref(PRIV_TASK, STRING, STRING)
* BOOL config_bool(ENUM {JIT,STACKRECURSE,UNICODE}) * BOOL config_bool(ENUM {JIT,STACKRECURSE,UNICODE})
...@@ -64,7 +64,7 @@ regex.match ...@@ -64,7 +64,7 @@ regex.match
:: ::
BOOL regex.match(PRIV_CALL, PRIV_TASK, STRING subject, INT len=0, BOOL anchored=0, INT match_limit=0, INT offset_limit=0, BOOL notbol=0, BOOL noteol=0, BOOL notempty=0, BOOL notempty_atstart=0, BOOL no_jit=0, BOOL no_utf_check=0, ENUM {HARD,SOFT} partial=0, INT recursion_limit=0) BOOL regex.match(PRIV_CALL, PRIV_TASK, STRING subject, INT len=0, BOOL anchored=0, INT match_limit=0, INT offset_limit=0, BOOL notbol=0, BOOL noteol=0, BOOL notempty=0, BOOL notempty_atstart=0, BOOL no_jit=0, BOOL no_utf_check=0, INT recursion_limit=0)
.. _func_regex.backref: .. _func_regex.backref:
...@@ -91,7 +91,7 @@ match ...@@ -91,7 +91,7 @@ match
:: ::
BOOL match(PRIV_CALL, PRIV_TASK, STRING pattern, STRING subject, BOOL allow_empty_class=0, BOOL anchored=0, ENUM {ANYCRLF,UNICODE} bsr=0, BOOL alt_bsux=0, BOOL alt_circumflex=0, BOOL alt_verbnames=0, BOOL caseless=0, BOOL dollar_endonly=0, BOOL dotall=0, BOOL dupnames=0, BOOL extended=0, BOOL firstline=0, STRING locale=0, BOOL match_unset_backref=0, INT max_pattern_len=0, BOOL multiline=0, BOOL never_backslash_c=0, BOOL never_ucp=0, BOOL never_utf=0, ENUM {CR,LF,CRLF,ANYCRLF,ANY} newline=0, BOOL no_auto_capture=0, BOOL no_auto_possess=0, BOOL no_dotstar_anchor=0, BOOL no_start_optimize=0, BOOL no_utf_check=0, INT parens_nest_limit=0, BOOL ucp=0, BOOL ungreedy=0, BOOL use_offset_limit=0, BOOL utf=0, INT len=0, INT match_limit=0, INT offset_limit=0, BOOL notbol=0, BOOL noteol=0, BOOL notempty=0, BOOL notempty_atstart=0, BOOL no_jit=0, ENUM {HARD,SOFT} partial=0, INT recursion_limit=0) BOOL match(PRIV_CALL, PRIV_TASK, STRING pattern, STRING subject, BOOL allow_empty_class=0, BOOL anchored=0, ENUM {ANYCRLF,UNICODE} bsr=0, BOOL alt_bsux=0, BOOL alt_circumflex=0, BOOL alt_verbnames=0, BOOL caseless=0, BOOL dollar_endonly=0, BOOL dotall=0, BOOL dupnames=0, BOOL extended=0, BOOL firstline=0, STRING locale=0, BOOL match_unset_backref=0, INT max_pattern_len=0, BOOL multiline=0, BOOL never_backslash_c=0, BOOL never_ucp=0, BOOL never_utf=0, ENUM {CR,LF,CRLF,ANYCRLF,ANY} newline=0, BOOL no_auto_capture=0, BOOL no_auto_possess=0, BOOL no_dotstar_anchor=0, BOOL no_start_optimize=0, BOOL no_utf_check=0, INT parens_nest_limit=0, BOOL ucp=0, BOOL ungreedy=0, BOOL use_offset_limit=0, BOOL utf=0, INT len=0, INT match_limit=0, INT offset_limit=0, BOOL notbol=0, BOOL noteol=0, BOOL notempty=0, BOOL notempty_atstart=0, BOOL no_jit=0, INT recursion_limit=0)
.. _func_backref: .. _func_backref:
......
...@@ -110,15 +110,15 @@ ...@@ -110,15 +110,15 @@
VCL_INT len, VCL_BOOL anchored, VCL_INT match_limit, \ VCL_INT len, VCL_BOOL anchored, VCL_INT match_limit, \
VCL_INT offset_limit, VCL_BOOL notbol, VCL_BOOL noteol, \ VCL_INT offset_limit, VCL_BOOL notbol, VCL_BOOL noteol, \
VCL_BOOL notempty, VCL_BOOL notempty_atstart, \ VCL_BOOL notempty, VCL_BOOL notempty_atstart, \
VCL_BOOL no_jit, VCL_BOOL no_utf_check, VCL_ENUM partials, \ VCL_BOOL no_jit, VCL_BOOL no_utf_check, \
VCL_INT recursion_limit VCL_INT recursion_limit \
/* Doesn't repeat the anchored and no_utf_check options */ /* Doesn't repeat the anchored and no_utf_check options */
#define MATCHF_OPTS \ #define MATCHF_OPTS \
VCL_INT len, VCL_INT match_limit, VCL_INT offset_limit, \ VCL_INT len, VCL_INT match_limit, VCL_INT offset_limit, \
VCL_BOOL notbol, VCL_BOOL noteol, VCL_BOOL notempty, \ VCL_BOOL notbol, VCL_BOOL noteol, VCL_BOOL notempty, \
VCL_BOOL notempty_atstart, VCL_BOOL no_jit, \ VCL_BOOL notempty_atstart, VCL_BOOL no_jit, \
VCL_ENUM partials, VCL_INT recursion_limit VCL_INT recursion_limit
#define MATCH_CTX_OPTS \ #define MATCH_CTX_OPTS \
VCL_INT match_limit, VCL_INT offset_limit, VCL_INT recursion_limit VCL_INT match_limit, VCL_INT offset_limit, VCL_INT recursion_limit
...@@ -129,11 +129,11 @@ ...@@ -129,11 +129,11 @@
#define MATCH_FLAGS \ #define MATCH_FLAGS \
VCL_BOOL anchored, VCL_BOOL notbol, VCL_BOOL noteol, \ VCL_BOOL anchored, VCL_BOOL notbol, VCL_BOOL noteol, \
VCL_BOOL notempty, VCL_BOOL notempty_atstart, \ VCL_BOOL notempty, VCL_BOOL notempty_atstart, \
VCL_BOOL no_jit, VCL_BOOL no_utf_check, VCL_ENUM partials VCL_BOOL no_jit, VCL_BOOL no_utf_check
#define MATCH_FLAGS_PARAMS \ #define MATCH_FLAGS_PARAMS \
anchored, notbol, noteol, notempty, notempty_atstart, no_jit, \ anchored, notbol, noteol, notempty, notempty_atstart, no_jit, \
no_utf_check, partials no_utf_check
struct vmod_pcre2_regex { struct vmod_pcre2_regex {
unsigned magic; unsigned magic;
...@@ -498,9 +498,6 @@ set_match_flags(uint32_t *options, MATCH_FLAGS) ...@@ -498,9 +498,6 @@ set_match_flags(uint32_t *options, MATCH_FLAGS)
set_opt(options, notempty_atstart, PCRE2_NOTEMPTY_ATSTART); set_opt(options, notempty_atstart, PCRE2_NOTEMPTY_ATSTART);
set_opt(options, no_jit, PCRE2_NO_JIT); set_opt(options, no_jit, PCRE2_NO_JIT);
set_opt(options, no_utf_check, PCRE2_NO_UTF_CHECK); set_opt(options, no_utf_check, PCRE2_NO_UTF_CHECK);
/* Partial matching not implemented yet */
AZ(partials);
} }
static pcre2_code * static pcre2_code *
......
...@@ -36,8 +36,7 @@ $Method BOOL .match(PRIV_CALL, PRIV_TASK, STRING subject, INT len=0, ...@@ -36,8 +36,7 @@ $Method BOOL .match(PRIV_CALL, PRIV_TASK, STRING subject, INT len=0,
BOOL anchored=0, INT match_limit=0, INT offset_limit=0, BOOL anchored=0, INT match_limit=0, INT offset_limit=0,
BOOL notbol=0, BOOL noteol=0, BOOL notempty=0, BOOL notbol=0, BOOL noteol=0, BOOL notempty=0,
BOOL notempty_atstart=0, BOOL no_jit=0, BOOL notempty_atstart=0, BOOL no_jit=0,
BOOL no_utf_check = 0, ENUM {HARD, SOFT} partial=0, BOOL no_utf_check=0, INT recursion_limit=0)
INT recursion_limit=0)
$Method STRING .backref(INT ref, STRING fallback = "**BACKREF METHOD FAILED**") $Method STRING .backref(INT ref, STRING fallback = "**BACKREF METHOD FAILED**")
...@@ -62,7 +61,7 @@ $Function BOOL match(PRIV_CALL, PRIV_TASK, STRING pattern, STRING subject, ...@@ -62,7 +61,7 @@ $Function BOOL match(PRIV_CALL, PRIV_TASK, STRING pattern, STRING subject,
INT len=0, INT match_limit=0, INT offset_limit=0, INT len=0, INT match_limit=0, INT offset_limit=0,
BOOL notbol=0, BOOL noteol=0, BOOL notempty=0, BOOL notbol=0, BOOL noteol=0, BOOL notempty=0,
BOOL notempty_atstart=0, BOOL no_jit=0, BOOL notempty_atstart=0, BOOL no_jit=0,
ENUM {HARD, SOFT} partial=0, INT recursion_limit=0) INT recursion_limit=0)
$Function STRING backref(PRIV_TASK, INT ref, $Function STRING backref(PRIV_TASK, INT ref,
STRING fallback = "**BACKREF FUNCTION FAILED**") STRING fallback = "**BACKREF FUNCTION FAILED**")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment