Flexelint the new acceptor sources

parent e142af75
......@@ -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
......@@ -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;
/*--------------------------------------------------------------------
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 =
......
......@@ -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"
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment