Commit cc7c9e8d authored by venaas's avatar venaas Committed by venaas
Browse files

using debug functions in main()

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@67 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent ba96d1cc
CFLAGS = -g -Wall -pedantic -pthread
LDFLAGS = -lssl
OBJ = util.o radsecproxy.o
OBJ = util.o debug.o radsecproxy.o
all: radsecproxy
radsecproxy: $(OBJ) radsecproxy.o
radsecproxy: $(OBJ)
$(CC) $(CFLAGS) $(OBJ) $(LDFLAGS) -o radsecproxy
clean:
rm -f $(OBJ) radsecproxy
......@@ -49,6 +49,7 @@
#include <openssl/md5.h>
#include <openssl/hmac.h>
#include "radsecproxy.h"
#include "debug.h"
static struct options options;
static struct client *clients;
......@@ -1923,32 +1924,13 @@ void getmainconfig(const char *configfile) {
fclose(f);
}
#if 0
void parseargs(int argc, char **argv) {
int c;
while ((c = getopt(argc, argv, "p:")) != -1) {
switch (c) {
case 'p':
udp_server_port = optarg;
break;
default:
goto usage;
}
}
return;
usage:
printf("radsecproxy [ -p UDP-port ]\n");
exit(1);
}
#endif
int main(int argc, char **argv) {
pthread_t udpserverth;
/* pthread_attr_t joinable; */
int i;
debug(DBG_INFO, "debug test info");
debug(DBG_WARN, "debug test warn");
/* parseargs(argc, argv); */
getmainconfig(CONFIG_MAIN);
......@@ -1961,7 +1943,7 @@ int main(int argc, char **argv) {
if (client_udp_count) {
udp_server_listen = server_create('U');
if (pthread_create(&udpserverth, NULL /*&joinable*/, udpserverrd, NULL))
errx("pthread_create failed");
debug(DBG_ERR, "pthread_create failed");
}
if (client_tls_count || server_tls_count)
......@@ -1969,7 +1951,7 @@ int main(int argc, char **argv) {
for (i = 0; i < server_count; i++)
if (pthread_create(&servers[i].clientth, NULL, clientwr, (void *)&servers[i]))
errx("pthread_create failed");
debug(DBG_ERR, "pthread_create failed");
if (client_tls_count) {
tcp_server_listen = server_create('T');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment