From 04327094c64c143143cc2e790aa33890a0e23bff Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Tue, 1 Oct 2013 17:08:38 +0100 Subject: [PATCH] Set the user agent to onak/ for HKP backend --- keydb_hkp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/keydb_hkp.c b/keydb_hkp.c index f1dfe44..3802e49 100644 --- a/keydb_hkp.c +++ b/keydb_hkp.c @@ -31,6 +31,7 @@ #include "mem.h" #include "onak-conf.h" #include "parsekey.h" +#include "version.h" static CURL *curl = NULL; @@ -43,6 +44,11 @@ static void hkp_initdb(bool readonly) { curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); + if (curl == NULL) { + logthing(LOGTHING_CRITICAL, "Could not initialize CURL."); + exit(EXIT_FAILURE); + } + curl_easy_setopt(curl, CURLOPT_USERAGENT, "onak/" ONAK_VERSION); } /** -- 2.39.2