Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent
Commits
5669adee
Commit
5669adee
authored
Mar 31, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix an off-by-one error reading chunks into a VSB
parent
9ef5b13e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
format.c
src/format.c
+1
-0
format.h
src/format.h
+1
-1
test_format.c
src/test/test_format.c
+2
-2
No files found.
src/format.c
View file @
5669adee
...
...
@@ -94,6 +94,7 @@ get_payload(logline_t *rec)
chunk
=
VSTAILQ_NEXT
(
chunk
,
chunklist
);
}
}
assert
(
VSB_len
(
payload
)
==
rec
->
len
);
VSB_finish
(
payload
);
}
...
...
src/format.h
View file @
5669adee
...
...
@@ -31,7 +31,7 @@
/* including source must include varnishevent.h and vre.h */
/* XXX: init as fixed size with length
shm_reclen
*/
/* XXX: init as fixed size with length
max_reclen + 1
*/
struct
vsb
*
payload
;
/* XXX: init time_start_re as VRE_compile(TS_START_REGEX) */
...
...
src/test/test_format.c
View file @
5669adee
...
...
@@ -54,7 +54,7 @@ static const char
CONF_Init
();
payload
=
VSB_new
(
NULL
,
NULL
,
DEFAULT_MAX_RECLEN
,
VSB_FIXEDLEN
);
payload
=
VSB_new
(
NULL
,
NULL
,
DEFAULT_MAX_RECLEN
+
1
,
VSB_FIXEDLEN
);
MAN
(
payload
);
time_start_re
=
VRE_compile
(
TS_START_REGEX
,
VRE_CASELESS
,
&
error
,
...
...
@@ -106,7 +106,7 @@ static const char
}
char
*
str
=
(
char
*
)
malloc
(
config
.
max_reclen
);
MAN
(
str
);
sprintf
(
str
,
"%0*d"
,
config
.
max_reclen
-
1
,
0
);
sprintf
(
str
,
"%0*d"
,
config
.
max_reclen
,
0
);
get_payload
(
&
rec
);
MASSERT
(
strcmp
(
VSB_data
(
payload
),
str
)
==
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