From 65b11cb96820066bea93747b85f6aaf7c8a712a6 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant <“bsergean@gmail.com”> Date: Thu, 18 Apr 2019 09:11:12 -0700 Subject: [PATCH] docker container works with SSL + fix compiler warnings in statsd third_party module --- DOCKER_VERSION | 2 +- Dockerfile | 3 ++- makefile | 2 +- test/run.py | 1 + third_party/statsd-client-cpp/src/statsd_client.cpp | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/DOCKER_VERSION b/DOCKER_VERSION index 88c5fb89..9df886c4 100644 --- a/DOCKER_VERSION +++ b/DOCKER_VERSION @@ -1 +1 @@ -1.4.0 +1.4.2 diff --git a/Dockerfile b/Dockerfile index 765a872f..1dc53df3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,10 +28,11 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update # Runtime RUN apt-get install -y libssl1.1 +RUN apt-get install -y ca-certificates +RUN ["update-ca-certificates"] # Debugging RUN apt-get install -y strace -RUN apt-get install -y gdb RUN apt-get install -y procps RUN apt-get install -y htop diff --git a/makefile b/makefile index 76251df5..38adfb4a 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,7 @@ all: brew install: brew brew: - mkdir -p build && (cd build ; cmake .. ; make -j install) + mkdir -p build && (cd build ; cmake -DUSE_TLS=1 .. ; make -j install) .PHONY: docker diff --git a/test/run.py b/test/run.py index 7e1e3ed4..488a298c 100755 --- a/test/run.py +++ b/test/run.py @@ -111,6 +111,7 @@ def runCMake(sanitizer, buildDir): {sanitizerFlag} \ -B{buildDir} \ -DCMAKE_BUILD_TYPE=Debug \ + -DUSE_TLS=1 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ ''' cmakeCmd = fmt.format(**locals()) diff --git a/third_party/statsd-client-cpp/src/statsd_client.cpp b/third_party/statsd-client-cpp/src/statsd_client.cpp index 74e43984..e58af652 100644 --- a/third_party/statsd-client-cpp/src/statsd_client.cpp +++ b/third_party/statsd-client-cpp/src/statsd_client.cpp @@ -49,7 +49,7 @@ StatsdClient::StatsdClient(const string& host, d = new _StatsdClientData; d->sock = -1; config(host, port, ns); - srandom(time(NULL)); + srandom((unsigned) time(NULL)); if (batching_) { pthread_mutex_init(&batching_mutex_lock_, nullptr); @@ -227,7 +227,7 @@ int StatsdClient::send_to_daemon(const string &message) { { return ret; } - ret = sendto(d->sock, message.data(), message.size(), 0, (struct sockaddr *) &d->server, sizeof(d->server)); + ret = (int) sendto(d->sock, message.data(), message.size(), 0, (struct sockaddr *) &d->server, sizeof(d->server)); if ( ret == -1) { snprintf(d->errmsg, sizeof(d->errmsg), "sendto server fail, host=%s:%d, err=%m", d->host.c_str(), d->port);