]> the.earth.li Git - onak.git/commitdiff
Set the user agent to onak/<version> for HKP backend
authorJonathan McDowell <noodles@earth.li>
Tue, 1 Oct 2013 16:08:38 +0000 (17:08 +0100)
committerJonathan McDowell <noodles@earth.li>
Tue, 1 Oct 2013 16:08:38 +0000 (17:08 +0100)
keydb_hkp.c

index f1dfe4477786b83b087359533d5e95457b6b5532..3802e4985b60bcb5076ff139a80cc236f695606d 100644 (file)
@@ -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);
 }
 
 /**