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
d5a8bac1
Commit
d5a8bac1
authored
Jan 28, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
un-inline a couple of enum-to-string functions
parent
09939bc4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
29 deletions
+36
-29
cache.h
bin/varnishd/cache/cache.h
+4
-26
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-1
cache_panic.c
bin/varnishd/cache/cache_panic.c
+30
-1
cache_session.c
bin/varnishd/cache/cache_session.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
d5a8bac1
...
...
@@ -54,7 +54,6 @@
#include <sys/epoll.h>
#endif
#include "common/params.h"
/*--------------------------------------------------------------------*/
...
...
@@ -73,18 +72,6 @@ enum body_status {
#undef BODYSTATUS
};
static
inline
const
char
*
body_status
(
enum
body_status
e
)
{
switch
(
e
)
{
#define BODYSTATUS(U,l) case BS_##U: return (#l);
#include "tbl/body_status.h"
#undef BODYSTATUS
default:
return
(
"?"
);
}
}
/*--------------------------------------------------------------------*/
enum
req_body_state_e
{
...
...
@@ -102,19 +89,6 @@ enum sess_close {
#undef SESS_CLOSE
};
static
inline
const
char
*
sess_close_str
(
enum
sess_close
sc
,
int
want_desc
)
{
switch
(
sc
)
{
case
SC_NULL
:
return
(
want_desc
?
"(null)"
:
"NULL"
);
#define SESS_CLOSE(nm, desc) case SC_##nm: return(want_desc ? desc : #nm);
#include "tbl/sess_close.h"
#undef SESS_CLOSE
default:
return
(
want_desc
?
"(invalid)"
:
"INVALID"
);
}
}
/*--------------------------------------------------------------------*/
/*
...
...
@@ -129,6 +103,8 @@ enum {
#undef SLTH
};
/*--------------------------------------------------------------------*/
struct
SHA256Context
;
struct
VSC_C_lck
;
struct
ban
;
...
...
@@ -960,6 +936,8 @@ void MPL_Free(struct mempool *mpl, void *item);
/* cache_panic.c */
void
PAN_Init
(
void
);
const
char
*
body_status_2str
(
enum
body_status
e
);
const
char
*
sess_close_2str
(
enum
sess_close
sc
,
int
want_desc
);
/* cache_pipe.c */
void
PipeRequest
(
struct
req
*
req
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
d5a8bac1
...
...
@@ -611,7 +611,7 @@ FetchBody(struct worker *wrk, void *priv)
bo
->
vfp
=
NULL
;
VSLb
(
bo
->
vsl
,
SLT_Fetch_Body
,
"%u(%s) cls %d mklen %d"
,
htc
->
body_status
,
body_status
(
htc
->
body_status
),
htc
->
body_status
,
body_status
_2str
(
htc
->
body_status
),
cls
,
mklen
);
http_Teardown
(
bo
->
bereq
);
...
...
bin/varnishd/cache/cache_panic.c
View file @
d5a8bac1
...
...
@@ -61,6 +61,35 @@ static void pan_sess(const struct sess *sp);
/*--------------------------------------------------------------------*/
const
char
*
body_status_2str
(
enum
body_status
e
)
{
switch
(
e
)
{
#define BODYSTATUS(U,l) case BS_##U: return (#l);
#include "tbl/body_status.h"
#undef BODYSTATUS
default:
return
(
"?"
);
}
}
/*--------------------------------------------------------------------*/
const
char
*
sess_close_2str
(
enum
sess_close
sc
,
int
want_desc
)
{
switch
(
sc
)
{
case
SC_NULL
:
return
(
want_desc
?
"(null)"
:
"NULL"
);
#define SESS_CLOSE(nm, desc) case SC_##nm: return(want_desc ? desc : #nm);
#include "tbl/sess_close.h"
#undef SESS_CLOSE
default:
return
(
want_desc
?
"(invalid)"
:
"INVALID"
);
}
}
/*--------------------------------------------------------------------*/
static
void
pan_ws
(
const
struct
ws
*
ws
,
int
indent
)
{
...
...
@@ -216,7 +245,7 @@ pan_busyobj(const struct busyobj *bo)
if
(
bo
->
do_stream
)
VSB_printf
(
pan_vsp
,
" do_stream
\n
"
);
if
(
bo
->
should_close
)
VSB_printf
(
pan_vsp
,
" should_close
\n
"
);
VSB_printf
(
pan_vsp
,
" bodystatus = %d (%s),
\n
"
,
bo
->
htc
.
body_status
,
body_status
(
bo
->
htc
.
body_status
));
bo
->
htc
.
body_status
,
body_status
_2str
(
bo
->
htc
.
body_status
));
VSB_printf
(
pan_vsp
,
" },
\n
"
);
if
(
VALID_OBJ
(
bo
->
vbc
,
BACKEND_MAGIC
))
pan_vbc
(
bo
->
vbc
);
...
...
bin/varnishd/cache/cache_session.c
View file @
d5a8bac1
...
...
@@ -327,7 +327,7 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
b
=
&
sp
->
acct_ses
;
VSL
(
SLT_SessClose
,
sp
->
vxid
,
"%s %.3f %ju %ju %ju %ju %ju %ju"
,
sess_close_str
(
sp
->
reason
,
0
),
now
-
sp
->
t_open
,
b
->
req
,
sess_close_
2
str
(
sp
->
reason
,
0
),
now
-
sp
->
t_open
,
b
->
req
,
b
->
pipe
,
b
->
pass
,
b
->
fetch
,
b
->
hdrbytes
,
b
->
bodybytes
);
MPL_Free
(
pp
->
mpl_sess
,
sp
);
...
...
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