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
2905effa
Commit
2905effa
authored
Mar 31, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement and test formatters for %m
parent
b418d66d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
format.c
src/format.c
+3
-3
format.h
src/format.h
+3
-0
test_format.c
src/test/test_format.c
+29
-0
No files found.
src/format.c
View file @
2905effa
...
...
@@ -294,10 +294,10 @@ format_I_backend(tx_t *tx, char *name, enum VSL_tag_e tag, char **s,
*
len
=
strlen
(
*
s
);
}
#if 0
FORMAT
(
client
,
m
,
ReqMethod
)
FORMAT
(
backend
,
m
,
BereqMethod
)
FORMAT(client, m, RxRequest)
FORMAT(backend, m, TxRequest)
#if 0
#define FORMAT_q(dir, xurl) \
static void \
...
...
src/format.h
View file @
2905effa
...
...
@@ -68,3 +68,6 @@ formatter_f format_h_backend;
formatter_f
format_I_client
;
formatter_f
format_I_backend
;
formatter_f
format_m_client
;
formatter_f
format_m_backend
;
src/test/test_format.c
View file @
2905effa
...
...
@@ -527,6 +527,34 @@ static const char
return
NULL
;
}
static
const
char
*
test_format_m
(
void
)
{
tx_t
tx
;
logline_t
rec
;
chunk_t
chunk
;
char
*
str
;
size_t
len
;
printf
(
"... testing format_m_*()
\n
"
);
init_tx_rec_chunk
(
&
tx
,
&
rec
,
&
chunk
);
MAN
(
chunk
.
data
);
#define REQMETHOD_PAYLOAD "GET"
set_record_data
(
&
rec
,
&
chunk
,
REQMETHOD_PAYLOAD
,
SLT_ReqMethod
);
format_m_client
(
&
tx
,
NULL
,
SLT__Bogus
,
&
str
,
&
len
);
MASSERT
(
strcmp
(
str
,
"GET"
)
==
0
);
MASSERT
(
len
==
3
);
rec
.
tag
=
SLT_BereqMethod
;
format_m_backend
(
&
tx
,
NULL
,
SLT__Bogus
,
&
str
,
&
len
);
MASSERT
(
strcmp
(
str
,
"GET"
)
==
0
);
MASSERT
(
len
==
3
);
return
NULL
;
}
static
const
char
*
all_tests
(
void
)
{
...
...
@@ -542,6 +570,7 @@ static const char
mu_run_test
(
test_format_H
);
mu_run_test
(
test_format_h
);
mu_run_test
(
test_format_I
);
mu_run_test
(
test_format_m
);
return
NULL
;
}
...
...
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