diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-09-10 23:11:03 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-09-10 23:11:03 +0200 |
commit | 3bc6627dcc7d473d724b4d5c3af9a02151de587b (patch) | |
tree | 5d268d94344fc78621384ce0c427927db88f3d73 | |
parent | 7594180301f8a7668a3577cf956d4ac98d936529 (diff) |
nDPId: Removed thread_id nonsense as it does not provide any useful information and is not portable at all, not even on Linux systems ..
* nDPId: Removed blocking I/O warning, which causes logspams..
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | nDPId.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -18,7 +18,6 @@ #include <sys/epoll.h> #include <sys/ioctl.h> #include <sys/signalfd.h> -#include <sys/types.h> #include <sys/un.h> #include <unistd.h> #ifdef ENABLE_ZLIB @@ -247,7 +246,6 @@ struct nDPId_reader_thread { struct nDPId_workflow * workflow; pthread_t thread; - pid_t thread_id; int collector_sockfd; int collector_sock_last_errno; size_t array_index; @@ -514,9 +512,8 @@ static int set_collector_nonblock(struct nDPId_reader_thread * const reader_thre { reader_thread->collector_sock_last_errno = errno; logger(1, - "[%8llu, %d] Could not set collector fd %d to non-blocking mode: %s", + "[%8llu] Could not set collector fd %d to non-blocking mode: %s", reader_thread->workflow->packets_processed, - reader_thread->thread_id, reader_thread->collector_sockfd, strerror(errno)); return 1; @@ -533,9 +530,8 @@ static int set_collector_block(struct nDPId_reader_thread * const reader_thread) { reader_thread->collector_sock_last_errno = errno; logger(1, - "[%8llu, %d] Could not set collector fd %d to blocking mode: %s", + "[%8llu] Could not set collector fd %d to blocking mode: %s", reader_thread->workflow->packets_processed, - reader_thread->thread_id, reader_thread->collector_sockfd, strerror(errno)); return 1; @@ -2103,12 +2099,6 @@ static void send_to_collector(struct nDPId_reader_thread * const reader_thread, else if (collector_address.raw.sa_family == AF_UNIX) { size_t pos = (written < 0 ? 0 : written); - logger(0, - "[%8llu, %zu] Send less data then expected (%zu < %d bytes), falling back to blocking I/O", - workflow->packets_captured, - reader_thread->array_index, - pos, - s_ret); set_collector_block(reader_thread); while ((size_t)(written = write(reader_thread->collector_sockfd, newline_json_str + pos, s_ret - pos)) != s_ret - pos) @@ -4097,7 +4087,6 @@ static void * processing_thread(void * const ndpi_thread_arg) { struct nDPId_reader_thread * const reader_thread = (struct nDPId_reader_thread *)ndpi_thread_arg; - reader_thread->thread_id = gettid(); reader_thread->collector_sockfd = -1; if (connect_to_collector(reader_thread) != 0) |