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
22ff9649
Commit
22ff9649
authored
Aug 25, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get better diagnostics on ESI-code string errors.
Related to: #1773
parent
15968233
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+17
-8
No files found.
bin/varnishd/cache/cache_esi_deliver.c
View file @
22ff9649
...
@@ -187,7 +187,7 @@ ved_include(struct req *preq, const char *src, const char *host,
...
@@ -187,7 +187,7 @@ ved_include(struct req *preq, const char *src, const char *host,
#define Debug(fmt, ...)
/**/
#define Debug(fmt, ...)
/**/
static
ssize_t
static
ssize_t
ved_decode_len
(
uint8_t
**
pp
)
ved_decode_len
(
struct
req
*
req
,
uint8_t
**
pp
)
{
{
uint8_t
*
p
;
uint8_t
*
p
;
ssize_t
l
;
ssize_t
l
;
...
@@ -207,8 +207,9 @@ ved_decode_len(uint8_t **pp)
...
@@ -207,8 +207,9 @@ ved_decode_len(uint8_t **pp)
p
+=
9
;
p
+=
9
;
break
;
break
;
default:
default:
Debug
(
"Illegal Length %d %d
\n
"
,
*
p
,
(
*
p
&
15
));
VSLb
(
req
->
vsl
,
SLT_Error
,
INCOMPL
();
"ESI-corruption: Illegal Length %d %d
\n
"
,
*
p
,
(
*
p
&
15
));
WRONG
(
"ESI-codes: illegal length"
);
}
}
*
pp
=
p
;
*
pp
=
p
;
assert
(
l
>
0
);
assert
(
l
>
0
);
...
@@ -286,12 +287,16 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
...
@@ -286,12 +287,16 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
case
VEC_V1
:
case
VEC_V1
:
case
VEC_V2
:
case
VEC_V2
:
case
VEC_V8
:
case
VEC_V8
:
ecx
->
l
=
ved_decode_len
(
&
ecx
->
p
);
ecx
->
l
=
ved_decode_len
(
req
,
&
ecx
->
p
);
if
(
ecx
->
l
<
0
)
return
(
-
1
);
if
(
ecx
->
isgzip
)
{
if
(
ecx
->
isgzip
)
{
assert
(
*
ecx
->
p
==
VEC_C1
||
assert
(
*
ecx
->
p
==
VEC_C1
||
*
ecx
->
p
==
VEC_C2
||
*
ecx
->
p
==
VEC_C2
||
*
ecx
->
p
==
VEC_C8
);
*
ecx
->
p
==
VEC_C8
);
l
=
ved_decode_len
(
&
ecx
->
p
);
l
=
ved_decode_len
(
req
,
&
ecx
->
p
);
if
(
l
<
0
)
return
(
-
1
);
icrc
=
vbe32dec
(
ecx
->
p
);
icrc
=
vbe32dec
(
ecx
->
p
);
ecx
->
p
+=
4
;
ecx
->
p
+=
4
;
if
(
ecx
->
isgzip
)
{
if
(
ecx
->
isgzip
)
{
...
@@ -305,7 +310,9 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
...
@@ -305,7 +310,9 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
case
VEC_S1
:
case
VEC_S1
:
case
VEC_S2
:
case
VEC_S2
:
case
VEC_S8
:
case
VEC_S8
:
ecx
->
l
=
ved_decode_len
(
&
ecx
->
p
);
ecx
->
l
=
ved_decode_len
(
req
,
&
ecx
->
p
);
if
(
ecx
->
l
<
0
)
return
(
-
1
);
Debug
(
"SKIP1(%d)
\n
"
,
(
int
)
ecx
->
l
);
Debug
(
"SKIP1(%d)
\n
"
,
(
int
)
ecx
->
l
);
ecx
->
state
=
4
;
ecx
->
state
=
4
;
break
;
break
;
...
@@ -327,8 +334,10 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
...
@@ -327,8 +334,10 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
ecx
->
p
=
r
+
1
;
ecx
->
p
=
r
+
1
;
break
;
break
;
default:
default:
Debug
(
"XXXX 0x%02x [%s]
\n
"
,
*
ecx
->
p
,
ecx
->
p
);
VSLb
(
req
->
vsl
,
SLT_Error
,
INCOMPL
();
"ESI corruption line %d 0x%02x [%s]
\n
"
,
__LINE__
,
*
ecx
->
p
,
ecx
->
p
);
WRONG
(
"ESI-codes: Illegal code"
);
}
}
break
;
break
;
case
2
:
case
2
:
...
...
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