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
2b6f3276
Commit
2b6f3276
authored
Jan 16, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn the confusion of busyobj flags into a #include table.
parent
c717cf00
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
30 deletions
+67
-30
cache.h
bin/varnishd/cache/cache.h
+3
-12
cache_panic.c
bin/varnishd/cache/cache_panic.c
+4
-7
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+15
-11
Makefile.am
include/Makefile.am
+1
-0
bo_flags.h
include/tbl/bo_flags.h
+44
-0
No files found.
bin/varnishd/cache/cache.h
View file @
2b6f3276
...
...
@@ -527,8 +527,6 @@ struct busyobj {
struct
req
*
req
;
uint8_t
*
vary
;
unsigned
is_gzip
;
unsigned
is_gunzip
;
#define N_VFPS 5
vfp_pull_f
*
vfps
[
N_VFPS
];
...
...
@@ -551,18 +549,11 @@ struct busyobj {
struct
pool_task
fetch_task
;
unsigned
should_close
;
char
*
h_content_length
;
unsigned
do_esi
;
unsigned
do_gzip
;
unsigned
do_gunzip
;
unsigned
do_stream
;
/* do_pass is our intent, uncacheable is the result */
unsigned
do_pass
;
unsigned
uncacheable
;
unsigned
abandon
;
#define BO_FLAG(l, r, w, d) unsigned l:1;
#include "tbl/bo_flags.h"
#undef BO_FLAG
/* Timeouts */
double
connect_timeout
;
...
...
bin/varnishd/cache/cache_panic.c
View file @
2b6f3276
...
...
@@ -267,13 +267,10 @@ pan_busyobj(const struct busyobj *bo)
VSB_printf
(
pan_vsp
,
" busyobj = %p {
\n
"
,
bo
);
pan_ws
(
bo
->
ws
,
4
);
if
(
bo
->
is_gzip
)
VSB_printf
(
pan_vsp
,
" is_gzip
\n
"
);
if
(
bo
->
is_gunzip
)
VSB_printf
(
pan_vsp
,
" is_gunzip
\n
"
);
if
(
bo
->
do_gzip
)
VSB_printf
(
pan_vsp
,
" do_gzip
\n
"
);
if
(
bo
->
do_gunzip
)
VSB_printf
(
pan_vsp
,
" do_gunzip
\n
"
);
if
(
bo
->
do_esi
)
VSB_printf
(
pan_vsp
,
" do_esi
\n
"
);
if
(
bo
->
do_stream
)
VSB_printf
(
pan_vsp
,
" do_stream
\n
"
);
if
(
bo
->
should_close
)
VSB_printf
(
pan_vsp
,
" should_close
\n
"
);
#define BO_FLAG(l, r, w, d) if(bo->l) VSB_printf(pan_vsp, " is_" #l "\n");
#include "tbl/bo_flags.h"
#undef BO_FLAG
VSB_printf
(
pan_vsp
,
" bodystatus = %d (%s),
\n
"
,
bo
->
htc
.
body_status
,
body_status_2str
(
bo
->
htc
.
body_status
));
VSB_printf
(
pan_vsp
,
" },
\n
"
);
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
2b6f3276
...
...
@@ -121,27 +121,31 @@ VRT_DO_STATUS(beresp)
/*--------------------------------------------------------------------*/
#define VBERESP(dir, type, onm, field) \
#define VBERESPW0(field)
#define VBERESPW1(field) \
void \
VRT_l_
##dir##_##onm(const struct vrt_ctx *ctx, type a)
\
VRT_l_
beresp_##field(const struct vrt_ctx *ctx, unsigned a)
\
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); \
ctx->bo->field = a; \
} \
\
type \
VRT_r_##dir##_##onm(const struct vrt_ctx *ctx) \
ctx->bo->field = a ? 1 : 0; \
}
#define VBERESPR0(field)
#define VBERESPR1(field) \
unsigned \
VRT_r_beresp_##field(const struct vrt_ctx *ctx) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); \
return (ctx->bo->field); \
}
VBERESP
(
beresp
,
unsigned
,
do_esi
,
do_esi
)
VBERESP
(
beresp
,
unsigned
,
do_gzip
,
do_gzip
)
VBERESP
(
beresp
,
unsigned
,
do_gunzip
,
do_gunzip
)
VBERESP
(
beresp
,
unsigned
,
do_stream
,
do_stream
)
#define BO_FLAG(l, r, w, d) \
VBERESPR##r(l) \
VBERESPW##r(l)
#include "tbl/bo_flags.h"
#undef BO_FLAG
/*--------------------------------------------------------------------*/
...
...
include/Makefile.am
View file @
2b6f3276
...
...
@@ -5,6 +5,7 @@ nobase_pkginclude_HEADERS = \
tbl/acct_fields.h
\
tbl/backend_poll.h
\
tbl/ban_vars.h
\
tbl/bo_flags.h
\
tbl/body_status.h
\
tbl/debug_bits.h
\
tbl/feature_bits.h
\
...
...
include/tbl/bo_flags.h
0 → 100644
View file @
2b6f3276
/*-
* Copyright (c) 2014 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.
*
*/
/*lint -save -e525 -e539 */
/* lower, vcl_r, vcl_w, doc */
BO_FLAG
(
do_esi
,
1
,
1
,
""
)
BO_FLAG
(
do_gzip
,
1
,
1
,
""
)
BO_FLAG
(
do_gunzip
,
1
,
1
,
""
)
BO_FLAG
(
do_stream
,
1
,
1
,
""
)
BO_FLAG
(
do_pass
,
0
,
0
,
""
)
BO_FLAG
(
uncacheable
,
0
,
0
,
""
)
BO_FLAG
(
abandon
,
0
,
0
,
""
)
BO_FLAG
(
is_gzip
,
0
,
0
,
""
)
BO_FLAG
(
is_gunzip
,
0
,
0
,
""
)
BO_FLAG
(
should_close
,
0
,
0
,
""
)
/*lint -restore */
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