Skip to content

Commit 4af6f3c

Browse files
committed
Move variable SOCKET_CONF_FILENAME into socket interface
1 parent dd742ed commit 4af6f3c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/common/socket.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@
7979
static struct socket_interface sockt_s;
8080
struct socket_interface *sockt;
8181

82-
static const char *SOCKET_CONF_FILENAME = "conf/common/socket.conf";
83-
8482
#ifdef SEND_SHORTLIST
8583
// Add a fd to the shortlist so that it'll be recognized as a fd that needs
8684
// sending done on it.
@@ -1505,7 +1503,7 @@ static bool socket_config_read(const char *filename, bool imported)
15051503

15061504
// import should overwrite any previous configuration, so it should be called last
15071505
if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
1508-
if (strcmp(import, filename) == 0 || strcmp(import, SOCKET_CONF_FILENAME) == 0) {
1506+
if (strcmp(import, filename) == 0 || strcmp(import, sockt->SOCKET_CONF_FILENAME) == 0) {
15091507
ShowWarning("socket_config_read: Loop detected! Skipping 'import'...\n");
15101508
} else {
15111509
if (!socket_config_read(import, true))
@@ -1714,7 +1712,7 @@ static void socket_init(void)
17141712
// Get initial local ips
17151713
sockt->naddr_ = sockt->getips(sockt->addr_,16);
17161714

1717-
socket_config_read(SOCKET_CONF_FILENAME, false);
1715+
socket_config_read(sockt->SOCKET_CONF_FILENAME, false);
17181716

17191717
#ifndef SOCKET_EPOLL
17201718
// Select based Event Dispatcher:
@@ -2143,6 +2141,8 @@ void socket_defaults(void)
21432141
{
21442142
sockt = &sockt_s;
21452143

2144+
sockt->SOCKET_CONF_FILENAME = "conf/common/socket.conf";
2145+
21462146
sockt->fd_max = 0;
21472147
/* */
21482148
sockt->stall_time = 60;

src/common/socket.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ struct socket_interface {
178178
time_t stall_time;
179179
time_t last_tick;
180180

181+
const char *SOCKET_CONF_FILENAME;
181182
/* */
182183
uint32 addr_[16]; // ip addresses of local host (host byte order)
183184
int naddr_; // # of ip addresses

0 commit comments

Comments
 (0)