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
25b2dc31
Commit
25b2dc31
authored
Dec 12, 2022
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Constify the result from VPX_tlv()
parent
38dd0df7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
cache_proxy.h
bin/varnishd/proxy/cache_proxy.h
+1
-1
cache_proxy_proto.c
bin/varnishd/proxy/cache_proxy_proto.c
+1
-1
vmod_proxy.c
vmod/vmod_proxy.c
+9
-7
No files found.
bin/varnishd/proxy/cache_proxy.h
View file @
25b2dc31
...
...
@@ -40,6 +40,6 @@
#define PP2_SUBTYPE_SSL_KEY_ALG 0x25
#define PP2_SUBTYPE_SSL_MAX 0x25
int
VPX_tlv
(
const
struct
req
*
req
,
int
tlv
,
void
**
dst
,
int
*
len
);
int
VPX_tlv
(
const
struct
req
*
req
,
int
tlv
,
const
void
**
dst
,
int
*
len
);
void
VPX_Format_Proxy
(
struct
vsb
*
,
int
,
const
struct
suckaddr
*
,
const
struct
suckaddr
*
,
const
char
*
);
bin/varnishd/proxy/cache_proxy_proto.c
View file @
25b2dc31
...
...
@@ -286,7 +286,7 @@ vpx_tlv_itern(struct vpx_tlv_iter *vpi)
(vpi->e == NULL) && vpx_tlv_itern(itv);)
int
VPX_tlv
(
const
struct
req
*
req
,
int
typ
,
void
**
dst
,
int
*
len
)
VPX_tlv
(
const
struct
req
*
req
,
int
typ
,
const
void
**
dst
,
int
*
len
)
{
struct
vpx_tlv
*
tlv
;
struct
vpx_tlv_iter
vpi
[
1
],
vpi2
[
1
];
...
...
vmod/vmod_proxy.c
View file @
25b2dc31
...
...
@@ -55,11 +55,11 @@ struct pp2_tlv_ssl {
static
VCL_BOOL
tlv_ssl_flag
(
VRT_CTX
,
int
flag
)
{
struct
pp2_tlv_ssl
*
dst
;
const
struct
pp2_tlv_ssl
*
dst
;
int
len
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
VPX_tlv
(
ctx
->
req
,
PP2_TYPE_SSL
,
(
void
**
)
&
dst
,
&
len
))
if
(
VPX_tlv
(
ctx
->
req
,
PP2_TYPE_SSL
,
(
const
void
**
)
&
dst
,
&
len
))
return
(
0
);
return
((
dst
->
client
&
flag
)
==
flag
);
...
...
@@ -87,11 +87,11 @@ vmod_client_has_cert_conn(VRT_CTX)
VCL_INT
v_matchproto_
(
td_proxy_ssl_verify_result
)
vmod_ssl_verify_result
(
VRT_CTX
)
{
struct
pp2_tlv_ssl
*
dst
;
const
struct
pp2_tlv_ssl
*
dst
;
int
len
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
VPX_tlv
(
ctx
->
req
,
PP2_TYPE_SSL
,
(
void
**
)
&
dst
,
&
len
))
if
(
VPX_tlv
(
ctx
->
req
,
PP2_TYPE_SSL
,
(
const
void
**
)
&
dst
,
&
len
))
return
(
0
);
/* X509_V_OK */
return
(
vbe32dec
(
&
dst
->
verify
));
...
...
@@ -100,19 +100,21 @@ vmod_ssl_verify_result(VRT_CTX)
static
VCL_STRING
tlv_string
(
VRT_CTX
,
int
tlv
)
{
char
*
dst
,
*
d
;
const
char
*
ptr
;
char
*
d
;
int
len
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
VPX_tlv
(
ctx
->
req
,
tlv
,
(
void
**
)
&
dst
,
&
len
))
if
(
VPX_tlv
(
ctx
->
req
,
tlv
,
(
const
void
**
)
&
ptr
,
&
len
))
return
(
NULL
);
d
=
WS_Alloc
(
ctx
->
ws
,
len
+
1
);
if
(
d
==
NULL
)
{
VRT_fail
(
ctx
,
"proxy.TLV: out of workspace"
);
return
(
NULL
);
}
memcpy
(
d
,
dst
,
len
);
AN
(
ptr
);
memcpy
(
d
,
ptr
,
len
);
d
[
len
]
=
'\0'
;
return
(
d
);
}
...
...
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