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
85109613
Commit
85109613
authored
Aug 08, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the boundary detection code in vsl.c, slightly more paranoid than
DocWilcos proposed fix in #956
parent
573e86f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
vsl.c
lib/libvarnishapi/vsl.c
+14
-4
No files found.
lib/libvarnishapi/vsl.c
View file @
85109613
...
...
@@ -173,20 +173,30 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
for
(
w
=
0
;
w
<
TIMEOUT_USEC
;)
{
t
=
*
vsl
->
log_ptr
;
if
(
t
==
VSL_WRAPMARKER
||
(
t
==
VSL_ENDMARKER
&&
vsl
->
last_seq
!=
vsl
->
log_start
[
0
]))
{
if
(
t
==
VSL_WRAPMARKER
)
{
/* Wrap around not possible at front */
assert
(
vsl
->
log_ptr
!=
vsl
->
log_start
+
1
);
vsl
->
log_ptr
=
vsl
->
log_start
+
1
;
vsl
->
last_seq
=
vsl
->
log_start
[
0
];
VRMB
();
continue
;
}
}
if
(
t
==
VSL_ENDMARKER
)
{
if
(
vsl
->
log_ptr
!=
vsl
->
log_start
+
1
&&
vsl
->
last_seq
!=
vsl
->
log_start
[
0
])
{
/* ENDMARKER not at front and seq wrapped */
vsl
->
log_ptr
=
vsl
->
log_start
+
1
;
VRMB
();
continue
;
}
if
(
vsl
->
flags
&
F_NON_BLOCKING
)
return
(
-
1
);
w
+=
SLEEP_USEC
;
assert
(
usleep
(
SLEEP_USEC
)
==
0
||
errno
==
EINTR
);
continue
;
}
if
(
vsl
->
log_ptr
==
vsl
->
log_start
+
1
)
vsl
->
last_seq
=
vsl
->
log_start
[
0
];
*
pp
=
(
void
*
)(
uintptr_t
)
vsl
->
log_ptr
;
/* Loose volatile */
vsl
->
log_ptr
=
VSL_NEXT
(
vsl
->
log_ptr
);
return
(
1
);
...
...
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