Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
fa80a6a6
Commit
fa80a6a6
authored
Feb 20, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start marking variables with VCL versions.
(It doesn't get to the C code yet.)
parent
01379caf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
18 deletions
+73
-18
vcl_var.rst
doc/sphinx/reference/vcl_var.rst
+46
-10
generate.py
lib/libvcc/generate.py
+27
-8
No files found.
doc/sphinx/reference/vcl_var.rst
View file @
fa80a6a6
...
@@ -215,7 +215,7 @@ req.url
...
@@ -215,7 +215,7 @@ req.url
The requested URL, for instance "/robots.txt".
The requested URL, for instance "/robots.txt".
req.proto
req.proto
``VCL <= 4.0``
Type: STRING
Type: STRING
...
@@ -223,6 +223,14 @@ req.proto
...
@@ -223,6 +223,14 @@ req.proto
Writable from: client
Writable from: client
The HTTP protocol version used by the client, usually "HTTP/1.1"
or "HTTP/2.0".
req.proto ``VCL >= 4.1``
Type: STRING
Readable from: client
The HTTP protocol version used by the client, usually "HTTP/1.1"
The HTTP protocol version used by the client, usually "HTTP/1.1"
or "HTTP/2.0".
or "HTTP/2.0".
...
@@ -302,7 +310,7 @@ req.xid
...
@@ -302,7 +310,7 @@ req.xid
Unique ID of this request.
Unique ID of this request.
req.esi
req.esi
``VCL <= 4.0``
Type: BOOL
Type: BOOL
...
@@ -312,9 +320,8 @@ req.esi
...
@@ -312,9 +320,8 @@ req.esi
Set to `false` to disable ESI processing
Set to `false` to disable ESI processing
regardless of any value in beresp.do_esi. Defaults
regardless of any value in beresp.do_esi. Defaults
to `true`. This variable is subject to change in
to `true`. This variable is replaced by `resp.do_esi`
future versions, you should avoid using it.
in VCL 4.1.
req.can_gzip
req.can_gzip
...
@@ -515,7 +522,7 @@ bereq.url
...
@@ -515,7 +522,7 @@ bereq.url
The requested URL, copied from `req.url`
The requested URL, copied from `req.url`
bereq.proto
bereq.proto
``VCL <= 4.0``
Type: STRING
Type: STRING
...
@@ -526,6 +533,15 @@ bereq.proto
...
@@ -526,6 +533,15 @@ bereq.proto
The HTTP protocol version, "HTTP/1.1" unless a pass or pipe
The HTTP protocol version, "HTTP/1.1" unless a pass or pipe
request has "HTTP/1.0" in `req.proto`
request has "HTTP/1.0" in `req.proto`
bereq.proto ``VCL >= 4.1``
Type: STRING
Readable from: vcl_pipe, backend
The HTTP protocol version, "HTTP/1.1" unless a pass or pipe
request has "HTTP/1.0" in `req.proto`
bereq.http.*
bereq.http.*
...
@@ -620,7 +636,7 @@ beresp.body
...
@@ -620,7 +636,7 @@ beresp.body
For producing a synthetic body.
For producing a synthetic body.
beresp.proto
beresp.proto
``VCL <= 4.0``
Type: STRING
Type: STRING
...
@@ -630,6 +646,14 @@ beresp.proto
...
@@ -630,6 +646,14 @@ beresp.proto
The HTTP protocol version the backend replied with.
The HTTP protocol version the backend replied with.
beresp.proto ``VCL >= 4.1``
Type: STRING
Readable from: vcl_backend_response, vcl_backend_error
The HTTP protocol version the backend replied with.
beresp.status
beresp.status
...
@@ -855,7 +879,6 @@ obj.proto
...
@@ -855,7 +879,6 @@ obj.proto
Readable from: vcl_hit
Readable from: vcl_hit
The HTTP protocol version stored in the object.
The HTTP protocol version stored in the object.
...
@@ -959,7 +982,10 @@ resp
...
@@ -959,7 +982,10 @@ resp
~~~~
~~~~
This is the response we send to the client, it is built from either
This is the response we send to the client, it is built from either
`beresp` (pass/miss) or `obj` (hits).
`beresp` (pass/miss), `obj` (hits) or created from whole cloth (synth).
With the exception of `resp.body` all `resp.*` variables available
in both `vcl_deliver{}` and `vcl_synth{}` as a matter of symmetry.
resp
resp
...
@@ -978,7 +1004,17 @@ resp.body
...
@@ -978,7 +1004,17 @@ resp.body
To produce a synthetic response body, for instance for errors.
To produce a synthetic response body, for instance for errors.
resp.proto
resp.proto ``VCL <= 4.0``
Type: STRING
Readable from: vcl_deliver, vcl_synth
Writable from: vcl_deliver, vcl_synth
The HTTP protocol version to use for the response.
resp.proto ``VCL >= 4.1``
Type: STRING
Type: STRING
...
...
lib/libvcc/generate.py
View file @
fa80a6a6
...
@@ -169,21 +169,41 @@ returns = (
...
@@ -169,21 +169,41 @@ returns = (
sp_variables
=
collections
.
OrderedDict
()
sp_variables
=
collections
.
OrderedDict
()
class
vardef
(
object
):
class
vardef
(
object
):
def
__init__
(
self
,
nam
,
typ
,
rd
,
wr
,
doc
,
uns
):
def
__init__
(
self
,
nam
,
typ
,
rd
,
wr
,
wu
,
vlo
,
vhi
):
if
nam
in
sp_variables
:
return
sp_variables
[
nam
]
=
self
sp_variables
[
nam
]
=
self
self
.
nam
=
nam
self
.
nam
=
nam
self
.
typ
=
typ
self
.
typ
=
typ
self
.
rd
=
rd
self
.
rd
=
rd
self
.
wr
=
wr
self
.
wr
=
wr
self
.
doc
=
doc
self
.
uns
=
wu
self
.
uns
=
uns
self
.
vlo
=
vlo
self
.
vhi
=
vhi
def
parse_vcl
(
x
):
vlo
,
vhi
=
(
0
,
99
)
x
=
x
.
split
()
if
x
[
0
]
==
"VCL"
and
x
[
1
]
==
"<="
:
vhi
=
int
(
float
(
x
[
2
])
*
10
)
elif
x
[
0
]
==
"VCL"
and
x
[
1
]
==
">="
:
vlo
=
int
(
float
(
x
[
2
])
*
10
)
else
:
print
(
"Unknown variable version spec"
)
print
(
"XXX"
,
x
,
vlo
,
vhi
)
exit
(
2
)
return
vlo
,
vhi
def
parse_var
(
ln
):
def
parse_var
(
ln
):
vn
=
ln
.
pop
(
0
)
.
split
(
)
l1
=
ln
.
pop
(
0
)
.
split
(
"``"
)
assert
len
(
vn
)
==
1
assert
len
(
l1
)
in
(
1
,
3
)
vn
=
vn
[
0
]
vn
=
l1
[
0
]
.
strip
()
if
vn
[
-
1
]
==
'*'
:
if
vn
[
-
1
]
==
'*'
:
vn
=
vn
[:
-
1
]
vn
=
vn
[:
-
1
]
if
len
(
l1
)
==
3
:
vlo
,
vhi
=
parse_vcl
(
l1
[
1
])
else
:
vlo
,
vhi
=
0
,
99
vr
=
[]
vr
=
[]
vw
=
[]
vw
=
[]
vu
=
[]
vu
=
[]
...
@@ -209,9 +229,8 @@ def parse_var(ln):
...
@@ -209,9 +229,8 @@ def parse_var(ln):
vu
.
append
(
i
.
strip
(
",."
))
vu
.
append
(
i
.
strip
(
",."
))
continue
continue
break
break
doc
=
"
\n
"
+
l
+
"
\n
"
+
"
\n
"
.
join
(
ln
)
if
vn
[:
8
]
!=
"storage."
:
if
vn
[:
8
]
!=
"storage."
:
vardef
(
vn
,
vt
,
vr
,
vw
,
doc
,
uns
=
vu
)
vardef
(
vn
,
vt
,
vr
,
vw
,
vu
,
vlo
,
vhi
)
def
parse_var_doc
(
fn
):
def
parse_var_doc
(
fn
):
s
=
0
s
=
0
...
...
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