Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Variable support VMOD
C Shell
Branch: 3.0

Switch IP to a pointer

128 bytes per variable is a lot to waste if it's not used.
latest commit f0b77366c4
@fgsch fgsch authored

README

This VMOD implements basic variable in VCL. Well. It's more of an
association list with support for strings, ints and reals.

There are methods to get and set each type.

Global variables have a lifespan that extends across requests and
VCLs, for as long as the vmod is loaded. Non-globals are local to a
single request.

Prototype, most should be self-explaining:

Function VOID set(STRING, STRING)
Function STRING get(STRING)

Function VOID global_set(STRING, STRING)
Function STRING global_get(STRING)

Function VOID set_int(STRING, INT)
Function INT get_int(STRING)

Function VOID set_string(STRING, STRING)
Function STRING get_string(STRING)

Function VOID set_real(STRING, REAL)
Function REAL get_real(STRING)

Function VOID set_duration(STRING, DURATION)
Function DURATION get_duration(STRING)

Function VOID set_ip(STRING, IP)
Function IP get_ip(STRING)

Function VOID clear()

clear() clears the whole non-global variable space.
Something went wrong with that request. Please try again.