diff options
author | Simo Sorce <simo@redhat.com> | 2012-01-16 11:35:51 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-01-17 19:25:21 -0500 |
commit | 1aec40b19514481b4b155bf46a71e8bca139ccba (patch) | |
tree | 6fb26081475734db9fb976ccc7bc864322d4f3f2 /proxy/src/gssproxy.c | |
parent | e4a560ed1df2fdac855f2e3f87ad24288cab9456 (diff) | |
download | gss-proxy-1aec40b19514481b4b155bf46a71e8bca139ccba.tar.gz gss-proxy-1aec40b19514481b4b155bf46a71e8bca139ccba.tar.xz gss-proxy-1aec40b19514481b4b155bf46a71e8bca139ccba.zip |
Add gssproxy_ctx
And store configuration context within it.
Diffstat (limited to 'proxy/src/gssproxy.c')
-rw-r--r-- | proxy/src/gssproxy.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c index f1d679f..ba11fa2 100644 --- a/proxy/src/gssproxy.c +++ b/proxy/src/gssproxy.c @@ -24,6 +24,7 @@ */ #include "config.h" +#include <stdlib.h> #include "popt.h" #include "gp_utils.h" @@ -35,11 +36,11 @@ int main(int argc, const char *argv[]) int opt_interactive = 0; int opt_version = 0; char *opt_config_file = NULL; - struct gp_config *config; verto_ctx *vctx; verto_ev *ev; int vflags; int fd; + struct gssproxy_ctx *gpctx; struct poptOption long_options[] = { POPT_AUTOHELP @@ -80,11 +81,16 @@ int main(int argc, const char *argv[]) opt_daemon = 2; } - config = read_config(opt_config_file, opt_daemon); + gpctx = calloc(1, sizeof(struct gssproxy_ctx)); - init_server(config->daemonize); + gpctx->config = read_config(opt_config_file, opt_daemon); + if (!gpctx->config) { + exit(EXIT_FAILURE); + } + + init_server(gpctx->config->daemonize); - fd = init_unix_socket(config->socket_name); + fd = init_unix_socket(gpctx->config->socket_name); if (fd == -1) { return 1; } @@ -99,6 +105,7 @@ int main(int argc, const char *argv[]) if (!ev) { return 1; } + verto_set_private(ev, gpctx, NULL); verto_run(vctx); |