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
9b216d2e
Commit
9b216d2e
authored
Jun 16, 2016
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stringify boc_state
parent
d94b4a88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
7 deletions
+54
-7
cache.h
bin/varnishd/cache/cache.h
+3
-6
cache_panic.c
bin/varnishd/cache/cache_panic.c
+15
-1
boc_state.h
include/tbl/boc_state.h
+36
-0
No files found.
bin/varnishd/cache/cache.h
View file @
9b216d2e
...
...
@@ -360,12 +360,9 @@ struct storeobj {
* The macro-states we expose outside the fetch code
*/
enum
boc_state_e
{
BOS_INVALID
=
0
,
/* don't touch (yet) */
BOS_REQ_DONE
,
/* beresp.* can be examined */
BOS_PREP_STREAM
,
/* Prepare for streaming */
BOS_STREAM
,
/* beresp.* can be examined */
BOS_FINISHED
,
/* object is complete */
BOS_FAILED
,
/* something went wrong */
#define BOC_STATE(U, l) BOS_##U,
#include "tbl/boc_state.h"
#undef BOC_STATE
};
struct
boc
{
...
...
bin/varnishd/cache/cache_panic.c
View file @
9b216d2e
...
...
@@ -94,6 +94,20 @@ reqbody_status_2str(enum req_body_state_e e)
/*--------------------------------------------------------------------*/
static
const
char
*
boc_state_2str
(
enum
boc_state_e
e
)
{
switch
(
e
)
{
#define BOC_STATE(U,l) case BOS_##U: return(#l);
#include "tbl/boc_state.h"
#undef BOC_STATE
default:
return
(
"?"
);
}
}
/*--------------------------------------------------------------------*/
const
char
*
sess_close_2str
(
enum
sess_close
sc
,
int
want_desc
)
{
...
...
@@ -231,7 +245,7 @@ pan_boc(struct vsb *vsb, const struct boc *boc)
VSB_indent
(
vsb
,
2
);
PAN_CheckMagic
(
vsb
,
boc
,
BOC_MAGIC
);
VSB_printf
(
vsb
,
"refcnt = %u,
\n
"
,
boc
->
refcount
);
VSB_printf
(
vsb
,
"state = %
d,
\n
"
,
boc
->
state
);
VSB_printf
(
vsb
,
"state = %
s,
\n
"
,
boc_state_2str
(
boc
->
state
)
);
VSB_printf
(
vsb
,
"vary = %p,
\n
"
,
boc
->
vary
);
VSB_printf
(
vsb
,
"stevedore_priv = %p,
\n
"
,
boc
->
stevedore_priv
);
VSB_indent
(
vsb
,
-
2
);
...
...
include/tbl/boc_state.h
0 → 100644
View file @
9b216d2e
/*-
* Copyright (c) 2016 Varnish Software AS
* All rights reserved.
*
* Author: Federico G. Schwindt <fgsch@lodoss.net>
*
* 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 */
BOC_STATE
(
INVALID
,
invalid
)
/* don't touch (yet) */
BOC_STATE
(
REQ_DONE
,
req_done
)
/* beresp.* can be examined */
BOC_STATE
(
PREP_STREAM
,
prep_stream
)
/* Prepare for streaming */
BOC_STATE
(
STREAM
,
stream
)
/* beresp.* can be examined */
BOC_STATE
(
FINISHED
,
finished
)
/* object is complete */
BOC_STATE
(
FAILED
,
failed
)
/* something went wrong */
/*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