From: W.C.A. Wijngaards Date: Thu, 23 Jan 2020 14:49:36 +0000 (+0100) Subject: dnstap io, remove libfstrm calls from dnstap.c. X-Git-Tag: 1.11.0rc1~120^2~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c64c4b78e15d19ec5a2b169e12ab9ec0f8e8165;p=thirdparty%2Funbound.git dnstap io, remove libfstrm calls from dnstap.c. --- diff --git a/dnstap/dnstap.c b/dnstap/dnstap.c index d8bc155aa..0cf3ff7b5 100644 --- a/dnstap/dnstap.c +++ b/dnstap/dnstap.c @@ -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); diff --git a/dnstap/dnstap.h b/dnstap/dnstap.h index 428691ed9..c87a549aa 100644 --- a/dnstap/dnstap.h +++ b/dnstap/dnstap.h @@ -40,19 +40,13 @@ #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;