diff options
author | Jakub Sławiński | 2005-11-03 20:37:56 +0100 |
---|---|---|
committer | Joshua Judson Rosen | 2014-07-17 21:15:00 +0200 |
commit | 63bbc710b23893742e5ccbd430f95bf2d29c2da6 (patch) | |
tree | 06d0585724cff8a4f1a7c052b5b89fd12c404094 /src/server_signals.c | |
parent | v0.7.2 (diff) | |
download | apf-63bbc710b23893742e5ccbd430f95bf2d29c2da6.tar.gz |
v0.7.4
- Fixed: sockets in CLOSE_WAIT state left by afclient
- Added: --localname and --localport options
- Added: --localdesname option
- Added: kicking user in 'opening' state
- Fixed: info about kicked user
- Fixed: TERM signal handling
- Fixed: id lost after reconnection
- Fixed: printing wrong client name in 'SSL_accept failed (timeout)' message
- Fixed: ignored 'certificate' and 'key' options from config file
- Added: config files for afclient
- Modified: some options in afserver config file
Diffstat (limited to 'src/server_signals.c')
-rw-r--r-- | src/server_signals.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/server_signals.c b/src/server_signals.c index ae5388d..55ceb4a 100644 --- a/src/server_signals.c +++ b/src/server_signals.c @@ -26,14 +26,16 @@ #include "http_proxy_functions.h" #include "stats.h" #include "logging.h" +#include "server_configuration_struct.h" -extern ConfigurationT config; +extern ServerConfiguration* config; void server_sig_int(int signo) { int i, j; unsigned char buff[5]; + ServerRealm** scRealmsTable; #ifdef HAVE_LIBPTHREAD if (!is_this_a_mainthread()) { @@ -41,24 +43,28 @@ server_sig_int(int signo) } #endif - for (j = 0; j < config.size; ++j) { + for (j = 0; j < ServerConfiguration_get_realmsNumber(config); ++j) { + scRealmsTable = ServerConfiguration_get_realmsTable(config); buff[0] = AF_S_CLOSING; /* closing */ - for (i = 0; i < config.realmtable[j].clinum; ++i) { - if (ConnectClient_get_state(config.realmtable[j].clitable[i]) == + for (i = 0; i < ServerRealm_get_clientsLimit(scRealmsTable[j]); ++i) { + if (ConnectClient_get_state(ServerRealm_get_clientsTable(scRealmsTable[j])[i]) == CONNECTCLIENT_STATE_ACCEPTED) { - SslFd_send_message(config.realmtable[j].type, + SslFd_send_message(ServerRealm_get_realmType(scRealmsTable[j]), ConnectClient_get_sslFd( - config.realmtable[j].clitable[i]), + ServerRealm_get_clientsTable(scRealmsTable[j])[i]), buff, 5); + close(SslFd_get_fd(ConnectClient_get_sslFd( + ServerRealm_get_clientsTable(scRealmsTable[j])[i]))); } } - for (i = 0; i < config.realmtable[j].raclinum; ++i) { - if (ConnectClient_get_state(config.realmtable[j].raclitable[i]) == + for (i = 0; i < ServerRealm_get_raClientsLimit(scRealmsTable[j]); ++i) { + if (ConnectClient_get_state(ServerRealm_get_raClientsTable(scRealmsTable[j])[i]) == CONNECTCLIENT_STATE_ACCEPTED) { - SslFd_send_message(config.realmtable[j].type | TYPE_SSL, + SslFd_send_message(ServerRealm_get_realmType(scRealmsTable[j]) | TYPE_SSL, ConnectClient_get_sslFd( - config.realmtable[j].raclitable[i]), + ServerRealm_get_raClientsTable(scRealmsTable[j])[i]), buff, 5); + close(SslFd_get_fd(ConnectClient_get_sslFd(ServerRealm_get_raClientsTable(scRealmsTable[j])[i]))); } } |