From b3e33daf7dbcb873aaab113b3a0f29ceb20a442a Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 4 Mar 2020 17:23:40 -0500 Subject: [PATCH 1/2] Fix CLANG build break Former-commit-id: c2a98a60f964f28455a5d04e18b88a9a45c9e586 --- src/server.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server.h b/src/server.h index 1e6632576..94d8a0d11 100644 --- a/src/server.h +++ b/src/server.h @@ -55,6 +55,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { #include From 3b1f36a521d4d33a6833a41a49a547ba7f64473e Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 15 Mar 2020 18:32:05 -0400 Subject: [PATCH 2/2] Update MOTD URL Former-commit-id: cd76a71de393eb527f98024ea85a9492ef0c36ca --- src/motd.cpp | 2 +- src/motd.h | 2 ++ src/redis-cli.c | 2 ++ src/server.cpp | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/motd.cpp b/src/motd.cpp index e46ba8819..8ad0b9caa 100644 --- a/src/motd.cpp +++ b/src/motd.cpp @@ -87,7 +87,7 @@ extern "C" char *fetchMOTD(int cache) str = sdsnew(""); curl = curl_easy_init(); if(curl) { - curl_easy_setopt(curl, CURLOPT_URL, "http://api.keydb.dev/motd/motd.txt"); + curl_easy_setopt(curl, CURLOPT_URL, motd_url); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); // follow redirects curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2); // take no more than two seconds curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, motd_write_callback); diff --git a/src/motd.h b/src/motd.h index 70fa7bb1d..31479c9b2 100644 --- a/src/motd.h +++ b/src/motd.h @@ -1,5 +1,7 @@ #pragma once +extern const char *motd_url; + #ifdef __cplusplus extern "C" { #endif diff --git a/src/redis-cli.c b/src/redis-cli.c index 7332c40e0..c8aaab6db 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -93,6 +93,8 @@ int spectrum_palette_size; int g_fInCrash = 0; +const char *motd_url = "http://api.keydb.dev/motd/motd_cli.txt"; + /*------------------------------------------------------------------------------ * Utility functions *--------------------------------------------------------------------------- */ diff --git a/src/server.cpp b/src/server.cpp index d6fe1ba1f..1ec2c0d7a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -65,6 +65,7 @@ #include "motd.h" int g_fTestMode = false; +const char *motd_url = "http://api.keydb.dev/motd/motd_server.txt"; /* Our shared "common" objects */