X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=keydb_hkp.c;h=a65d11b238cb155cf9bc88dbc9eb9a708e2d0be9;hb=0c120d1895d25b59abe338862189be1b87447569;hp=6707ae6974f0cb34f4c1007615b29b0ada503082;hpb=2458360e75aa46091f60c16e041c07bffe2edefb;p=onak.git diff --git a/keydb_hkp.c b/keydb_hkp.c index 6707ae6..a65d11b 100644 --- a/keydb_hkp.c +++ b/keydb_hkp.c @@ -17,10 +17,11 @@ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include +#include #include #include #include -#include #include #include "armor.h" @@ -36,7 +37,7 @@ struct onak_hkp_dbctx { struct onak_db_config *config; /* Our DB config info */ CURL *curl; - char hkpbase[1024]; + char hkpbase[512]; }; static int hkp_parse_url(struct onak_hkp_dbctx *privctx, const char *url) @@ -49,11 +50,11 @@ static int hkp_parse_url(struct onak_hkp_dbctx *privctx, const char *url) proto[0] = host[0] = 0; port = 0; - matched = sscanf(url, "%5[a-z]://%256[a-zA-Z0-9.]:%u", proto, host, + matched = sscanf(url, "%5[a-z]://%256[a-zA-Z0-9.-]:%u", proto, host, &port); if (matched < 2) { proto[0] = 0; - sscanf(url, "%256[a-zA-Z0-9.]:%u", host, &port); + sscanf(url, "%256[a-zA-Z0-9.-]:%u", host, &port); } if (host[0] == 0) { @@ -378,6 +379,8 @@ struct onak_dbctx *keydb_hkp_init(struct onak_db_config *dbcfg, bool readonly) if (!hkp_parse_url(privctx, dbcfg->location)) { exit(EXIT_FAILURE); } + logthing(LOGTHING_INFO, "Using %s as HKP forwarding URL.", + privctx->hkpbase); curl_global_init(CURL_GLOBAL_DEFAULT); privctx->curl = curl_easy_init(); if (privctx->curl == NULL) {