Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-re
Commits
4f64f9db
Commit
4f64f9db
authored
Nov 22, 2014
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the build dependency on pcre
parent
eaa2d571
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
57 deletions
+13
-57
configure.ac
configure.ac
+0
-31
Makefile.am
src/Makefile.am
+1
-2
vmod_re.c
src/vmod_re.c
+12
-11
vmod_re.vcc
src/vmod_re.vcc
+0
-13
No files found.
configure.ac
View file @
4f64f9db
...
...
@@ -29,41 +29,10 @@ if test "x$RST2MAN" = "xno"; then
fi
AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" != "xno"])
# Check for pkg-config
PKG_PROG_PKG_CONFIG
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([pthread.h])
if test -n $PKG_CONFIG; then
PKG_CHECK_MODULES([PCRE], [libpcre])
else
AC_CHECK_PROG(PCRE_CONFIG, pcre-config, pcre-config)
AC_ARG_WITH(pcre-config,
AS_HELP_STRING([--with-pcre-config=PATH],
[Location of PCRE pcre-config (auto)]),
[pcre_config="$withval"],
[pcre_config=""])
if test "x$pcre_config" != "x" ; then
AC_MSG_CHECKING(for $pcre_config)
if test -f $pcre_config ; then
PCRE_CONFIG=$pcre_config
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no - searching PATH)
fi
fi
if test "x$PCRE_CONFIG" = "x"; then
AC_CHECK_PROGS(PCRE_CONFIG, pcre-config)
fi
PCRE_CFLAGS=`$PCRE_CONFIG --cflags`
PCRE_LIBS=`$PCRE_CONFIG --libs`
fi
AC_SUBST(PCRE_CFLAGS)
AC_SUBST(PCRE_LIBS)
# Check for python
AC_CHECK_PROGS(PYTHON, [python3 python3.1 python3.2 python2.7 python2.6 python2.5 python2 python], [AC_MSG_ERROR([Python is needed to build this vmod, please install python.])])
...
...
src/Makefile.am
View file @
4f64f9db
AM_CPPFLAGS
=
@VMOD_INCLUDES@
@PCRE_CFLAGS@
AM_CPPFLAGS
=
@VMOD_INCLUDES@
vmoddir
=
@VMOD_DIR@
vmod_LTLIBRARIES
=
libvmod_re.la
libvmod_re_la_LDFLAGS
=
-module
-export-dynamic
-avoid-version
libvmod_re_la_LIBADD
=
@PCRE_LIBS@
libvmod_re_la_SOURCES
=
\
vcc_if.c
\
vcc_if.h
\
...
...
src/vmod_re.c
View file @
4f64f9db
...
...
@@ -32,8 +32,6 @@
#include <stdlib.h>
#include <pthread.h>
#include "pcre.h"
#include "vre.h"
#include "vrt.h"
#include "cache/cache.h"
...
...
@@ -204,7 +202,7 @@ vmod_regex_backref(const struct vrt_ctx *ctx, struct vmod_re_regex *re,
ov_t
*
ov
;
char
*
substr
;
unsigned
l
;
int
s
;
size_t
len
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
re
,
VMOD_RE_REGEX_MAGIC
);
...
...
@@ -238,18 +236,21 @@ vmod_regex_backref(const struct vrt_ctx *ctx, struct vmod_re_regex *re,
l
=
WS_Reserve
(
ctx
->
ws
,
0
);
substr
=
ctx
->
ws
->
f
;
s
=
pcre_copy_substring
(
ov
->
subject
,
ov
->
ovector
,
ov
->
count
,
refnum
,
substr
,
l
);
if
(
s
<
0
)
{
/* cf. pcre_copy_substring */
refnum
<<=
1
;
assert
(
refnum
+
1
<
MAX_OV_USED
);
len
=
ov
->
ovector
[
refnum
+
1
]
-
ov
->
ovector
[
refnum
];
if
(
len
+
1
>
l
)
{
VSLb
(
ctx
->
vsl
,
SLT_VCL_Error
,
"vmod re:
backref returned %d"
,
s
);
"vmod re:
insufficient workspace"
);
WS_Release
(
ctx
->
ws
,
0
);
return
fallback
;
}
if
(
s
+
1
>
l
)
VSLb
(
ctx
->
vsl
,
SLT_VCL_Error
,
"vmod re: insufficient workspace,"
" backref string truncated"
);
WS_Release
(
ctx
->
ws
,
s
+
1
);
assert
(
len
<=
strlen
(
ov
->
subject
+
ov
->
ovector
[
refnum
])
+
1
);
memcpy
(
substr
,
ov
->
subject
+
ov
->
ovector
[
refnum
],
len
);
substr
[
len
]
=
'\0'
;
WS_Release
(
ctx
->
ws
,
len
+
1
);
return
substr
;
}
...
...
src/vmod_re.vcc
View file @
4f64f9db
...
...
@@ -139,14 +139,6 @@ VMOD on a system where an instance of Varnish 4 is installed, and the
auto-tools will attempt to locate the Varnish instance, and then pull
in libraries and other support files from there.
This VMOD also requires a development version of the PCRE library for
the build (commonly in a package called ``pcre-devel`` in most Unix
distributions). The auto-tools attempt to use ``pcre-config`` to
determine compiler and linker options for PCRE.
Since the PCRE runtime library is already required for Varnish, the
VMOD adds no additional requirements for the runtime.
Quick start
-----------
...
...
@@ -174,11 +166,6 @@ before running ``configure``:
* export ACLOCAL_PATH=$PREFIX/share/aclocal
* export PATH=$PREFIX/bin:$PREFIX/sbin:$PATH
If ``pcre-config`` is not on your ``PATH``, call ``configure`` with
the option ``--with-pcre-config=/path/to/pcre-config``. Alternatively,
you can specify compiler and linker options for pcre by setting the
environment variables ``PCRE_CFLAGS`` and ``PCRE_LIBS``, respectively.
``configure`` must locate the ``varnishtest`` and ``varnishd``
binaries so that ``make check`` can be run. Usually it should be able
to find them, but if necessary you can set the variables
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment