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
7dbee047
Unverified
Commit
7dbee047
authored
Sep 30, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flexelint the new acceptor sources
parent
e142af75
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
52 deletions
+29
-52
acceptor_priv.h
bin/varnishd/acceptor/acceptor_priv.h
+21
-0
cache_acceptor.c
bin/varnishd/acceptor/cache_acceptor.c
+4
-5
cache_acceptor_tcp.c
bin/varnishd/acceptor/cache_acceptor_tcp.c
+2
-19
cache_acceptor_uds.c
bin/varnishd/acceptor/cache_acceptor_uds.c
+2
-19
mgt_acceptor.c
bin/varnishd/acceptor/mgt_acceptor.c
+0
-4
mgt_acceptor_tcp.c
bin/varnishd/acceptor/mgt_acceptor_tcp.c
+0
-2
mgt_acceptor_uds.c
bin/varnishd/acceptor/mgt_acceptor_uds.c
+0
-3
No files found.
bin/varnishd/acceptor/acceptor_priv.h
View file @
7dbee047
...
...
@@ -61,3 +61,24 @@ struct conn_heritage {
void
vca_pace_check
(
void
);
void
vca_pace_bad
(
void
);
void
vca_pace_good
(
void
);
union
sock_arg
{
struct
linger
lg
;
struct
timeval
tv
;
int
i
;
};
struct
sock_opt
{
int
level
;
int
optname
;
const
char
*
strname
;
unsigned
mod
;
socklen_t
sz
;
union
sock_arg
arg
[
1
];
};
#define SOCK_OPT(lvl, nam, typ) { lvl, nam, #nam, 1, sizeof(typ) },
// move to individual pools?
extern
unsigned
pool_accepting
;
// cache_acceptor.c
bin/varnishd/acceptor/cache_acceptor.c
View file @
7dbee047
...
...
@@ -48,14 +48,13 @@
#include "common/heritage.h"
#include "vcli_serve.h"
#include "vsa.h"
#include "vtcp.h"
#include "vtim.h"
static
pthread_t
VCA_thread
;
vtim_dur
vca_pace
=
0
.
0
;
struct
lock
pace_mtx
;
unsigned
pool_accepting
;
static
pthread_t
VCA_thread
;
static
vtim_dur
vca_pace
=
0
.
0
;
static
struct
lock
pace_mtx
;
static
pthread_mutex_t
shut_mtx
=
PTHREAD_MUTEX_INITIALIZER
;
/*--------------------------------------------------------------------
...
...
bin/varnishd/acceptor/cache_acceptor_tcp.c
View file @
7dbee047
...
...
@@ -51,31 +51,13 @@
#include "vtcp.h"
#include "vtim.h"
extern
vtim_dur
vca_pace
;
extern
struct
lock
pace_mtx
;
extern
unsigned
pool_accepting
;
/*--------------------------------------------------------------------
* TCP options we want to control
*/
union
sock_arg
{
struct
linger
lg
;
struct
timeval
tv
;
int
i
;
};
static
struct
sock_opt
{
int
level
;
int
optname
;
const
char
*
strname
;
unsigned
mod
;
socklen_t
sz
;
union
sock_arg
arg
[
1
];
}
sock_opts
[]
=
{
static
struct
sock_opt
sock_opts
[]
=
{
/* Note: Setting the mod counter to something not-zero is needed
* to force the setsockopt() calls on startup */
#define SOCK_OPT(lvl, nam, typ) { lvl, nam, #nam, 1, sizeof(typ) },
SOCK_OPT
(
SOL_SOCKET
,
SO_LINGER
,
struct
linger
)
SOCK_OPT
(
SOL_SOCKET
,
SO_KEEPALIVE
,
int
)
...
...
@@ -332,6 +314,7 @@ vca_tcp_event(struct cli *cli, struct listen_sock *ls, enum vca_event event)
{
char
h
[
VTCP_ADDRBUFSIZE
],
p
[
VTCP_PORTBUFSIZE
];
(
void
)
ls
;
// XXX const?
switch
(
event
)
{
case
VCA_EVENT_LADDR
:
VTCP_myname
(
ls
->
sock
,
h
,
sizeof
h
,
p
,
sizeof
p
);
...
...
bin/varnishd/acceptor/cache_acceptor_uds.c
View file @
7dbee047
...
...
@@ -51,10 +51,6 @@
#include "vtcp.h"
#include "vtim.h"
extern
vtim_dur
vca_pace
;
extern
struct
lock
pace_mtx
;
extern
unsigned
pool_accepting
;
/*--------------------------------------------------------------------
* We want to get out of any kind of trouble-hit TCP connections as fast
* as absolutely possible, so we set them LINGER disabled, so that even if
...
...
@@ -75,23 +71,9 @@ static const unsigned enable_so_keepalive = 1;
* UDS options we want to control
*/
union
sock_arg
{
struct
linger
lg
;
struct
timeval
tv
;
int
i
;
};
static
struct
sock_opt
{
int
level
;
int
optname
;
const
char
*
strname
;
unsigned
mod
;
socklen_t
sz
;
union
sock_arg
arg
[
1
];
}
sock_opts
[]
=
{
static
struct
sock_opt
sock_opts
[]
=
{
/* Note: Setting the mod counter to something not-zero is needed
* to force the setsockopt() calls on startup */
#define SOCK_OPT(lvl, nam, typ) { lvl, nam, #nam, 1, sizeof(typ) },
SOCK_OPT
(
SOL_SOCKET
,
SO_LINGER
,
struct
linger
)
SOCK_OPT
(
SOL_SOCKET
,
SO_KEEPALIVE
,
int
)
...
...
@@ -299,6 +281,7 @@ static void
vca_uds_event
(
struct
cli
*
cli
,
struct
listen_sock
*
ls
,
enum
vca_event
event
)
{
(
void
)
ls
;
// XXX const?
switch
(
event
)
{
case
VCA_EVENT_LADDR
:
CHECK_OBJ_NOTNULL
(
ls
,
LISTEN_SOCK_MAGIC
);
...
...
bin/varnishd/acceptor/mgt_acceptor.c
View file @
7dbee047
...
...
@@ -48,10 +48,6 @@
#include "common/heritage.h"
#include "vav.h"
#include "vcli_serve.h"
#include "vsa.h"
#include "vss.h"
#include "vtcp.h"
#include "vus.h"
static
VTAILQ_HEAD
(,
listen_arg
)
listen_args
=
...
...
bin/varnishd/acceptor/mgt_acceptor_tcp.c
View file @
7dbee047
...
...
@@ -49,8 +49,6 @@
#include "acceptor/acceptor_tcp.h"
#include "acceptor/mgt_acceptor.h"
#include "vav.h"
#include "vcli_serve.h"
#include "vsa.h"
#include "vss.h"
#include "vtcp.h"
...
...
bin/varnishd/acceptor/mgt_acceptor_uds.c
View file @
7dbee047
...
...
@@ -52,10 +52,7 @@
#include "acceptor/acceptor_uds.h"
#include "acceptor/mgt_acceptor.h"
#include "vav.h"
#include "vcli_serve.h"
#include "vsa.h"
#include "vss.h"
#include "vus.h"
int
...
...
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