summaryrefslogtreecommitdiff
path: root/nDPIsrvd.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-09-15 14:33:13 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-09-15 14:33:13 +0200
commite54c2df63b292257822cd07678fa20b38552585f (patch)
tree0141d26b36ad0a42c17926c5518d0f7e2d61bae7 /nDPIsrvd.c
parentc152e41cfb417eb586d9bb23049c4f70860f2ae3 (diff)
nDPIsrvd: Fixed anther bug, introduced during refactoring -_-
nDPId-test: Collect information about JSON string length's. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPIsrvd.c')
-rw-r--r--nDPIsrvd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nDPIsrvd.c b/nDPIsrvd.c
index 6231b2124..68f3ffe1f 100644
--- a/nDPIsrvd.c
+++ b/nDPIsrvd.c
@@ -30,7 +30,8 @@ struct remote_desc
int fd;
struct nDPIsrvd_buffer buf;
UT_array * buf_cache;
- union {
+ union
+ {
struct
{
int json_sockfd;
@@ -192,6 +193,7 @@ static int drain_main_buffer(struct remote_desc * const remote)
}
if ((size_t)bytes_written < remote->buf.used)
{
+#if 0
syslog(LOG_DAEMON,
"Distributor wrote less than expected to %.*s:%u: %zd < %zu",
(int)sizeof(remote->event_serv.peer_addr),
@@ -199,9 +201,10 @@ static int drain_main_buffer(struct remote_desc * const remote)
ntohs(remote->event_serv.peer.sin_port),
bytes_written,
remote->buf.used);
+#endif
memmove(remote->buf.ptr.raw, remote->buf.ptr.raw + bytes_written, remote->buf.used - bytes_written);
remote->buf.used -= bytes_written;
- return -1;
+ return 0;
}
remote->buf.used = 0;
@@ -578,7 +581,8 @@ static struct remote_desc * accept_remote(int server_fd,
static int new_connection(int epollfd, int eventfd)
{
- union {
+ union
+ {
struct sockaddr_un event_json;
struct sockaddr_un event_serv;
} sockaddr;