Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
unique-xids
Commits
d4681a6f
Commit
d4681a6f
authored
Aug 17, 2011
by
Per Buer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.varnish-cache.org/git/varnish-cache
parents
e416c09b
a8481d09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
4 deletions
+48
-4
vtc_http.c
bin/varnishtest/vtc_http.c
+42
-0
vtc_log.c
bin/varnishtest/vtc_log.c
+6
-4
No files found.
bin/varnishtest/vtc_http.c
View file @
d4681a6f
...
@@ -903,6 +903,47 @@ cmd_http_send(CMD_ARGS)
...
@@ -903,6 +903,47 @@ cmd_http_send(CMD_ARGS)
}
}
/**********************************************************************
* Send a hex string
*/
static
void
cmd_http_sendhex
(
CMD_ARGS
)
{
struct
http
*
hp
;
char
buf
[
3
],
*
q
;
uint8_t
*
p
;
int
i
,
j
,
l
;
(
void
)
cmd
;
(
void
)
vl
;
CAST_OBJ_NOTNULL
(
hp
,
priv
,
HTTP_MAGIC
);
AN
(
av
[
1
]);
AZ
(
av
[
2
]);
l
=
strlen
(
av
[
1
])
/
2
;
p
=
malloc
(
l
);
AN
(
p
);
q
=
av
[
1
];
for
(
i
=
0
;
i
<
l
;
i
++
)
{
while
(
vct_issp
(
*
q
))
q
++
;
if
(
*
q
==
'\0'
)
break
;
memcpy
(
buf
,
q
,
2
);
q
+=
2
;
buf
[
2
]
=
'\0'
;
if
(
!
vct_ishex
(
buf
[
0
])
||
!
vct_ishex
(
buf
[
1
]))
vtc_log
(
hp
->
vl
,
0
,
"Illegal Hex char
\"
%c%c
\"
"
,
buf
[
0
],
buf
[
1
]);
p
[
i
]
=
strtoul
(
buf
,
NULL
,
16
);
}
vtc_hexdump
(
hp
->
vl
,
4
,
"sendhex"
,
(
void
*
)
p
,
i
);
j
=
write
(
hp
->
fd
,
p
,
i
);
assert
(
j
==
i
);
free
(
p
);
}
/**********************************************************************
/**********************************************************************
* Send a string as chunked encoding
* Send a string as chunked encoding
*/
*/
...
@@ -1080,6 +1121,7 @@ static const struct cmds http_cmds[] = {
...
@@ -1080,6 +1121,7 @@ static const struct cmds http_cmds[] = {
{
"gunzip"
,
cmd_http_gunzip_body
},
{
"gunzip"
,
cmd_http_gunzip_body
},
{
"expect"
,
cmd_http_expect
},
{
"expect"
,
cmd_http_expect
},
{
"send"
,
cmd_http_send
},
{
"send"
,
cmd_http_send
},
{
"sendhex"
,
cmd_http_sendhex
},
{
"chunked"
,
cmd_http_chunked
},
{
"chunked"
,
cmd_http_chunked
},
{
"chunkedlen"
,
cmd_http_chunkedlen
},
{
"chunkedlen"
,
cmd_http_chunkedlen
},
{
"delay"
,
cmd_delay
},
{
"delay"
,
cmd_delay
},
...
...
bin/varnishtest/vtc_log.c
View file @
d4681a6f
...
@@ -227,8 +227,10 @@ vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx, const unsigned cha
...
@@ -227,8 +227,10 @@ vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx, const unsigned cha
{
{
int
nl
=
1
;
int
nl
=
1
;
unsigned
l
;
unsigned
l
;
double
tx
;
CHECK_OBJ_NOTNULL
(
vl
,
VTCLOG_MAGIC
);
CHECK_OBJ_NOTNULL
(
vl
,
VTCLOG_MAGIC
);
tx
=
TIM_mono
()
-
t0
;
assert
(
len
>=
0
);
assert
(
len
>=
0
);
assert
(
lvl
<
NLEAD
);
assert
(
lvl
<
NLEAD
);
AZ
(
pthread_mutex_lock
(
&
vl
->
mtx
));
AZ
(
pthread_mutex_lock
(
&
vl
->
mtx
));
...
@@ -236,8 +238,8 @@ vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx, const unsigned cha
...
@@ -236,8 +238,8 @@ vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx, const unsigned cha
if
(
pfx
==
NULL
)
if
(
pfx
==
NULL
)
pfx
=
""
;
pfx
=
""
;
if
(
str
==
NULL
)
if
(
str
==
NULL
)
VSB_printf
(
vl
->
vsb
,
"%s %-4s %
s(null)
\n
"
,
VSB_printf
(
vl
->
vsb
,
"%s %-4s %
4.1f %s| (null)
"
,
lead
[
lvl
],
vl
->
id
,
pfx
);
lead
[
lvl
],
vl
->
id
,
tx
,
pfx
);
else
{
else
{
for
(
l
=
0
;
l
<
len
;
l
++
,
str
++
)
{
for
(
l
=
0
;
l
<
len
;
l
++
,
str
++
)
{
if
(
l
>
512
)
{
if
(
l
>
512
)
{
...
@@ -245,8 +247,8 @@ vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx, const unsigned cha
...
@@ -245,8 +247,8 @@ vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx, const unsigned cha
break
;
break
;
}
}
if
(
nl
)
{
if
(
nl
)
{
VSB_printf
(
vl
->
vsb
,
"%s %-4s %s| "
,
VSB_printf
(
vl
->
vsb
,
"%s %-4s %
4.1f %
s| "
,
lead
[
lvl
],
vl
->
id
,
pfx
);
lead
[
lvl
],
vl
->
id
,
tx
,
pfx
);
nl
=
0
;
nl
=
0
;
}
}
VSB_printf
(
vl
->
vsb
,
" %02x"
,
*
str
);
VSB_printf
(
vl
->
vsb
,
" %02x"
,
*
str
);
...
...
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