]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
dnstap io, remove libfstrm calls from dnstap.c.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 23 Jan 2020 14:49:36 +0000 (15:49 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 23 Jan 2020 14:49:36 +0000 (15:49 +0100)
dnstap/dnstap.c
dnstap/dnstap.h

index d8bc155aa6751273255448872a809bf9e97243a6..0cf3ff7b5ab97bd84c82fa29c69af191a06024bd 100644 (file)
@@ -129,16 +129,10 @@ check_socket_file(const char* socket_path)
 }
 
 struct dt_env *
-dt_create(const char *socket_path, unsigned num_workers, struct config_file* cfg)
+dt_create(const char *socket_path, unsigned num_workers,
+       struct config_file* cfg)
 {
-#ifdef UNBOUND_DEBUG
-       fstrm_res res;
-#endif
        struct dt_env *env;
-       struct fstrm_iothr_options *fopt;
-       struct fstrm_unix_writer_options *fuwopt;
-       struct fstrm_writer *fw;
-       struct fstrm_writer_options *fwopt;
 
        verbose(VERB_OPS, "attempting to connect to dnstap socket %s",
                socket_path);
@@ -150,40 +144,9 @@ dt_create(const char *socket_path, unsigned num_workers, struct config_file* cfg
        if (!env)
                return NULL;
 
-       fwopt = fstrm_writer_options_init();
-#ifdef UNBOUND_DEBUG
-       res = 
-#else
-       (void)
-#endif
-           fstrm_writer_options_add_content_type(fwopt,
-               DNSTAP_CONTENT_TYPE, sizeof(DNSTAP_CONTENT_TYPE) - 1);
-       log_assert(res == fstrm_res_success);
-
-       fuwopt = fstrm_unix_writer_options_init();
-       fstrm_unix_writer_options_set_socket_path(fuwopt, socket_path);
-
-       fw = fstrm_unix_writer_init(fuwopt, fwopt);
-       log_assert(fw != NULL);
-
-       fopt = fstrm_iothr_options_init();
-       fstrm_iothr_options_set_num_input_queues(fopt, num_workers);
-       env->iothr = fstrm_iothr_init(fopt, &fw);
-       if (env->iothr == NULL) {
-               verbose(VERB_DETAIL, "dt_create: fstrm_iothr_init() failed");
-               fstrm_writer_destroy(&fw);
-               free(env);
-               env = NULL;
-       }
-       fstrm_iothr_options_destroy(&fopt);
-       fstrm_unix_writer_options_destroy(&fuwopt);
-       fstrm_writer_options_destroy(&fwopt);
-
        env->dtio = dt_io_thread_create();
        if(!env->dtio) {
                log_err("malloc failure");
-               fstrm_writer_destroy(&fw);
-               fstrm_iothr_destroy(&env->iothr);
                free(env);
                return NULL;
        }
@@ -276,9 +239,6 @@ dt_apply_cfg(struct dt_env *env, struct config_file *cfg)
 int
 dt_init(struct dt_env *env)
 {
-       env->ioq = fstrm_iothr_get_input_queue(env->iothr);
-       if (env->ioq == NULL)
-               return 0;
        env->msgqueue = dt_msg_queue_create();
        if(!env->msgqueue) {
                log_err("malloc failure");
@@ -304,7 +264,6 @@ dt_delete(struct dt_env *env)
        if (!env)
                return;
        verbose(VERB_OPS, "closing dnstap socket");
-       fstrm_iothr_destroy(&env->iothr);
        dt_io_thread_delete(env->dtio);
        free(env->identity);
        free(env->version);
index 428691ed951629eb78310dc1f383de363a8233c1..c87a549aa852b4b531046f12e6cf827f0d1315e9 100644 (file)
 #ifdef USE_DNSTAP
 
 struct config_file;
-struct fstrm_io;
-struct fstrm_queue;
 struct sldns_buffer;
 struct dt_msg_queue;
 
 struct dt_env {
-       /** dnstap I/O thread */
-       struct fstrm_iothr *iothr;
        /** the io thread (made by the struct daemon) */
        struct dt_io_thread* dtio;
 
-       /** dnstap I/O thread input queue */
-       struct fstrm_iothr_queue *ioq;
        /** valid in worker struct, not in daemon struct, the per-worker
         * message list */
        struct dt_msg_queue* msgqueue;