diff options
author | Jakub Sławiński | 2005-06-07 12:06:18 +0200 |
---|---|---|
committer | Joshua Judson Rosen | 2014-07-17 21:14:58 +0200 |
commit | 32aff2b27ccc3b3e51fb6f0bd77fe0073827c527 (patch) | |
tree | f2fc2530a6960f6fdf4d63eb80c4f61342250bbd /src/server_check.c | |
parent | v0.6 (diff) | |
download | apf-32aff2b27ccc3b3e51fb6f0bd77fe0073827c527.tar.gz |
v0.7
- Added: http proxy tunnels between afserver and afclient
- Fixed: sigint interception with threads enabled (in http proxy mode)
- Fixed: FATAL ERROR in afclient in some situations after close of afserver
when http proxy mode is enabled
- Added: afclients can connect directly to afserver with enabled proxy mode
- Fixed: timeout routine in http proxy tunnels
- Added: 'rshow' command in ra mode displays 'tunneltype'
- Fixed: printing IP of clients when http proxy mode is enabled
- Added: 'tunneltype' per client in ra mode after 'cshow' command
- Fixed: closing connection when http proxy mode is enabled
- Fixed: threads initialization
- Fixed: afserver closing after sigint
- Fixed: afclient threads initialization
- Added: 'version' option to display program version number
- Modified: establishing afclient<->afserver connection
- Added: 'keep-alive' option
- Fixed: using 'proxyport' without 'proxyname'
- Added: auto-reconnect feature to afclient
- Added: 'ar-tries' and 'ar-delay' options
- Modified: http proxy logging
- Fixed: closing connection with afclient after receiving id
- Fixed: thread closing due to wrong initialization sequence
- Fixed: small bug in initialization process
- Heavily Modified: logging routines
- Added: audit option
- Modified: default dateformat is now ISO 8601
- Modified: printing usage
- Fixed: bug in threads' initialization in afclient
- Added: 'timeout' and 'dateformat' options in ra mode
- Modified: empty dateformat disables printing '[] '
- Added: 'audit' and 'dnslookups' options in ra mode
- Fixed: afserver freeze bug
- Added: 'kuser' and 'kclient' options in ra mode
- Fixed: bug in starting afclient in ra mode
- Added: audit log printed also after kicking the client
Diffstat (limited to 'src/server_check.c')
-rw-r--r-- | src/server_check.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/server_check.c b/src/server_check.c index 94069cc..3fd1091 100644 --- a/src/server_check.c +++ b/src/server_check.c @@ -18,30 +18,45 @@ * */ +#include <config.h> + #include <stdio.h> #include <stdlib.h> #include <limits.h> +#include "server_check.h" #include "stats.h" +#include "logging.h" void check_value(int* where, char* what, char* info) { + long tmp = check_value_liberal(what, info); + + if (tmp <= 0) { + aflog(LOG_T_INIT, LOG_I_CRIT, + "%s: %d\n", info, tmp); + exit(1); + } + (*where) = tmp; +} + +int +check_value_liberal(char* what, char* info) +{ char* znak; long tmp; if ((tmp = strtol(what, &znak, 10)) >= INT_MAX) { - aflog(0, "%s: %s\n", info, what); + aflog(LOG_T_INIT, LOG_I_CRIT, + "%s: %s\n", info, what); exit(1); } if (((*what) == '\0') || (*znak != '\0')) { - aflog(0, "%s: %s\n", info, what); - exit(1); - } - if (tmp <= 0) { - aflog(0, "%s: %d\n", info, *where); + aflog(LOG_T_INIT, LOG_I_CRIT, + "%s: %s\n", info, what); exit(1); } - (*where) = tmp; + return tmp; } int |