]> err.no Git - yubikey-server-c/commitdiff
Pass ykc_config to request handler
authorTollef Fog Heen <tfheen@err.no>
Tue, 27 Oct 2009 20:35:57 +0000 (21:35 +0100)
committerTollef Fog Heen <tfheen@err.no>
Tue, 27 Oct 2009 20:35:57 +0000 (21:35 +0100)
src/main.c

index db1a0d6bf5fa46114e1eceaf316f6e52ee05da01..d3c5f99413d7f0088da415dfb60af45c3b038d6c 100644 (file)
@@ -357,7 +357,7 @@ free_mem:
        return r;
 }
 
-static int handle_request(void * UNUSED(data),
+static int handle_request(void * priv,
                          struct MHD_Connection *conn,
                          const char * url,
                          const char *UNUSED(method),
@@ -373,6 +373,7 @@ static int handle_request(void * UNUSED(data),
        size_t shared_secret_len;
        yubikey_token_st token;
        struct ykc_stats stats;
+       struct ykc_config *conf = (struct ykc_config*) priv;
        memset(&token, '\0', sizeof(token));
        memset(&stats, '\0', sizeof(stats));
 
@@ -592,7 +593,7 @@ int main(int argc, char ** argv)
                             NULL, /* Access policy handler */
                             NULL, /* Data to access policy handler */
                             handle_request, /* default handler for all URIs */
-                            NULL, /* Data for default handler */
+                            &conf, /* Data for default handler */
                             MHD_OPTION_END);
        if (d == NULL) {
                syslog(LOG_ERR, "could not start daemon, unsure why\n");