|
79 | 79 | static struct socket_interface sockt_s; |
80 | 80 | struct socket_interface *sockt; |
81 | 81 |
|
82 | | -static const char *SOCKET_CONF_FILENAME = "conf/common/socket.conf"; |
83 | | - |
84 | 82 | #ifdef SEND_SHORTLIST |
85 | 83 | // Add a fd to the shortlist so that it'll be recognized as a fd that needs |
86 | 84 | // sending done on it. |
@@ -1505,7 +1503,7 @@ static bool socket_config_read(const char *filename, bool imported) |
1505 | 1503 |
|
1506 | 1504 | // import should overwrite any previous configuration, so it should be called last |
1507 | 1505 | 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) { |
1509 | 1507 | ShowWarning("socket_config_read: Loop detected! Skipping 'import'...\n"); |
1510 | 1508 | } else { |
1511 | 1509 | if (!socket_config_read(import, true)) |
@@ -1714,7 +1712,7 @@ static void socket_init(void) |
1714 | 1712 | // Get initial local ips |
1715 | 1713 | sockt->naddr_ = sockt->getips(sockt->addr_,16); |
1716 | 1714 |
|
1717 | | - socket_config_read(SOCKET_CONF_FILENAME, false); |
| 1715 | + socket_config_read(sockt->SOCKET_CONF_FILENAME, false); |
1718 | 1716 |
|
1719 | 1717 | #ifndef SOCKET_EPOLL |
1720 | 1718 | // Select based Event Dispatcher: |
@@ -2143,6 +2141,8 @@ void socket_defaults(void) |
2143 | 2141 | { |
2144 | 2142 | sockt = &sockt_s; |
2145 | 2143 |
|
| 2144 | + sockt->SOCKET_CONF_FILENAME = "conf/common/socket.conf"; |
| 2145 | + |
2146 | 2146 | sockt->fd_max = 0; |
2147 | 2147 | /* */ |
2148 | 2148 | sockt->stall_time = 60; |
|
0 commit comments