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
c397697d
Commit
c397697d
authored
Sep 07, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add text representation to Fetch_Body VSL message.
parent
d56069e8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
8 deletions
+57
-8
body_status.h
bin/varnishd/body_status.h
+38
-0
cache.h
bin/varnishd/cache.h
+15
-6
cache_fetch.c
bin/varnishd/cache_fetch.c
+3
-2
flint.lnt
bin/varnishd/flint.lnt
+1
-0
No files found.
bin/varnishd/body_status.h
0 → 100644
View file @
c397697d
/*-
* Copyright (c) 2011 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Various ways to handle the body coming from the backend.
*/
/*lint -save -e525 -e539 */
BODYSTATUS
(
NONE
,
none
)
BODYSTATUS
(
ZERO
,
zero
)
BODYSTATUS
(
ERROR
,
error
)
BODYSTATUS
(
CHUNKED
,
chunked
)
BODYSTATUS
(
LENGTH
,
length
)
BODYSTATUS
(
EOF
,
eof
)
/*lint -restore */
bin/varnishd/cache.h
View file @
c397697d
...
...
@@ -66,14 +66,23 @@
#include "vsl.h"
enum
body_status
{
BS_NONE
,
BS_ZERO
,
BS_ERROR
,
BS_CHUNKED
,
BS_LENGTH
,
BS_EOF
#define BODYSTATUS(U,l) BS_##U,
#include "body_status.h"
#undef BODYSTATUS
};
static
inline
const
char
*
body_status
(
enum
body_status
e
)
{
switch
(
e
)
{
#define BODYSTATUS(U,l) case BS_##U: return (#l);
#include "body_status.h"
#undef BODYSTATUS
default:
return
(
"?"
);
}
}
/*
* NB: HDR_STATUS is only used in cache_http.c, everybody else uses the
* http->status integer field.
...
...
bin/varnishd/cache_fetch.c
View file @
c397697d
...
...
@@ -543,8 +543,9 @@ FetchBody(struct sess *sp)
*/
AZ
(
vfp_nop_end
(
sp
));
WSL
(
sp
->
wrk
,
SLT_Fetch_Body
,
sp
->
vbc
->
fd
,
"%u %d %u"
,
sp
->
wrk
->
body_status
,
cls
,
mklen
);
WSL
(
sp
->
wrk
,
SLT_Fetch_Body
,
sp
->
vbc
->
fd
,
"%u(%s) %d %u"
,
sp
->
wrk
->
body_status
,
body_status
(
sp
->
wrk
->
body_status
),
cls
,
mklen
);
if
(
sp
->
wrk
->
body_status
==
BS_ERROR
)
{
VDI_CloseFd
(
sp
);
...
...
bin/varnishd/flint.lnt
View file @
c397697d
...
...
@@ -86,6 +86,7 @@
-efile(451, "sys/\*.h") // No include guard
-efile(451, "machine/\*.h") // No include guard
-efile(451, "vcl_returns.h") // No include guard
-efile(451, "body_status.h") // No include guard
-efile(451, "locks.h") // No include guard
-efile(451, "cache_backend_poll.h") // No include guard
-efile(451, "steps.h") // No include guard
...
...
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