This commit is contained in:
2023-09-22 09:00:28 +02:00
parent da5bb1c54b
commit 64aaabf4e5
3 changed files with 15 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ FROM debian:bullseye AS builder
WORKDIR /app/src/ WORKDIR /app/src/
RUN apt-get -y -q update RUN apt-get -y -q update
RUN apt-get -y -q install make binutils gcc libc-dev RUN apt-get -y -q install make binutils gcc libc-dev tcpdump
COPY . . COPY . .
RUN ./configure --prefix=/app RUN ./configure --prefix=/app
RUN make clean all install clean RUN make clean all install clean
@@ -11,6 +11,9 @@ FROM debian:bullseye
WORKDIR /app WORKDIR /app
COPY --from=builder /app /app COPY --from=builder /app /app
USER daemon:daemon RUN apt-get -y -q update
RUN apt-get -y -q install tcpdump
#USER daemon:daemon
ENTRYPOINT ["/app/sbin/cworker"] ENTRYPOINT ["/app/sbin/cworker"]

View File

@@ -1,5 +1,5 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: StatefulSet
metadata: metadata:
name: cworker name: cworker
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}

View File

@@ -322,7 +322,15 @@ int cworker_handler(const cworker_t* worker, int socket) {
jblock_outjson(&jb, &jsonstr); jblock_outjson(&jb, &jsonstr);
jblock_destroy(&jb); jblock_destroy(&jb);
write(socket, jsonstr, strlen(jsonstr)); size_t jsize = strlen(jsonstr);
ssize_t wsize = write(socket, jsonstr, jsize);
if (wsize < 0) {
log_error("Write error: %s", strerror(errno));
}
if (wsize != jsize && wsize >= 0 ) {
log_error("Wrote only %ld from %ld", (size_t)wsize, jsize);
}
free(jsonstr); free(jsonstr);
//free(name); //free(name);
free(msg); free(msg);