Commit fb1dfce7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Request specific variables are not available in vcl_init{} and vcl_fini{}

parent 48bfc6dd
...@@ -98,107 +98,110 @@ returns =( ...@@ -98,107 +98,110 @@ returns =(
####################################################################### #######################################################################
# Variables available in sessions # Variables available in sessions
#
# 'all' means all methods
# 'proc' means all methods but 'init' and 'fini'
sp_variables = ( sp_variables = (
('client.ip', ('client.ip',
'IP', 'IP',
( 'all',), ( 'proc',),
( ), ( ),
'const struct sess *' 'const struct sess *'
), ),
('client.identity', ('client.identity',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'struct sess *' 'struct sess *'
), ),
('server.ip', ('server.ip',
'IP', 'IP',
( 'all',), ( 'proc',),
( ), ( ),
'struct sess *' 'struct sess *'
), ),
('server.hostname', ('server.hostname',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( ), ( ),
'struct sess *' 'struct sess *'
), ),
('server.identity', ('server.identity',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( ), ( ),
'struct sess *' 'struct sess *'
), ),
('server.port', ('server.port',
'INT', 'INT',
( 'all',), ( 'proc',),
( ), ( ),
'struct sess *' 'struct sess *'
), ),
('req.request', ('req.request',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'const struct sess *' 'const struct sess *'
), ),
('req.url', ('req.url',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'const struct sess *' 'const struct sess *'
), ),
('req.proto', ('req.proto',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'const struct sess *' 'const struct sess *'
), ),
('req.http.', ('req.http.',
'HDR_REQ', 'HDR_REQ',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'const struct sess *' 'const struct sess *'
), ),
('req.backend', ('req.backend',
'BACKEND', 'BACKEND',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'struct sess *' 'struct sess *'
), ),
('req.restarts', ('req.restarts',
'INT', 'INT',
( 'all',), ( 'proc',),
( ), ( ),
'const struct sess *' 'const struct sess *'
), ),
('req.esi_level', ('req.esi_level',
'INT', 'INT',
( 'all',), ( 'proc',),
( ), ( ),
'const struct sess *' 'const struct sess *'
), ),
('req.ttl', ('req.ttl',
'DURATION', 'DURATION',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'struct sess *' 'struct sess *'
), ),
('req.grace', ('req.grace',
'DURATION', 'DURATION',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'struct sess *' 'struct sess *'
), ),
('req.keep', ('req.keep',
'DURATION', 'DURATION',
( 'all',), ( 'proc',),
( 'all',), ( 'proc',),
'struct sess *' 'struct sess *'
), ),
('req.xid', ('req.xid',
'STRING', 'STRING',
( 'all',), ( 'proc',),
( ), ( ),
'struct sess *' 'struct sess *'
), ),
...@@ -210,13 +213,13 @@ sp_variables = ( ...@@ -210,13 +213,13 @@ sp_variables = (
), ),
('req.can_gzip', ('req.can_gzip',
'BOOL', 'BOOL',
( 'all',), ( 'proc',),
( ), ( ),
'struct sess *' 'struct sess *'
), ),
('req.backend.healthy', ('req.backend.healthy',
'BOOL', 'BOOL',
( 'all',), ( 'proc',),
( ), ( ),
'const struct sess *' 'const struct sess *'
), ),
...@@ -773,6 +776,11 @@ def restrict(fo, spec): ...@@ -773,6 +776,11 @@ def restrict(fo, spec):
return return
if spec[0] == 'all': if spec[0] == 'all':
spec = vcls spec = vcls
if spec[0] == 'proc':
spec = list()
for i in vcls:
if i != "init" and i != "fini":
spec.append(i)
p = "" p = ""
n = 0 n = 0
for j in spec: for j in spec:
......
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