tests/server: round of tidy-ups

Dedupe, merge macros, globals, make symbols local where possible.
Drop unused macros and headers. Drop `DEFAULT_LOGFILE` macro in favour
of `--logfile` command-line option.

Ref: #15000
Closes #16525
This commit is contained in:
Viktor Szakats 2024-09-08 16:18:57 +02:00
parent 387311012c
commit 9213e4e497
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
9 changed files with 66 additions and 137 deletions

View file

@ -85,17 +85,8 @@
/* include memdebug.h last */
#include "memdebug.h"
#ifdef USE_WINSOCK
#undef EINTR
#define EINTR 4 /* errno.h value */
#endif
#define DEFAULT_PORT 8905
#ifndef DEFAULT_LOGFILE
#define DEFAULT_LOGFILE "log/socksd.log"
#endif
#ifndef DEFAULT_REQFILE
#define DEFAULT_REQFILE "log/socksd-request.log"
#endif
@ -134,7 +125,6 @@ struct configurable {
static struct configurable config;
const char *serverlogfile = DEFAULT_LOGFILE;
static const char *reqlogfile = DEFAULT_REQFILE;
static const char *configfile = DEFAULT_CONFIG;
@ -979,6 +969,8 @@ int main(int argc, char *argv[])
bool unlink_socket = false;
#endif
serverlogfile = "log/socksd.log";
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("socksd IPv4%s\n",