Browse code

auth_identity: use app name to set curl user agent

Daniel-Constantin Mierla authored on 01/01/2018 13:50:18
Showing 1 changed files
... ...
@@ -208,7 +208,7 @@ static int mod_init(void)
208 208
 		return -2;
209 209
 	}
210 210
 	/* we pass our 'glb_tcert' struct to the callback function */
211
-	if ((iRet=curl_easy_setopt(glb_hcurl, CURLOPT_WRITEDATA, (void *)&glb_tcert.scertpem))!=0) {
211
+	if ((iRet=curl_easy_setopt(glb_hcurl, CURLOPT_WRITEDATA, (void *)(&glb_tcert.scertpem)))!=0) {
212 212
 		LOG(L_ERR,
213 213
 			"AUTH_IDENTITY:mod_init: Unable to set cURL writedata option: %s\n",
214 214
 			curl_easy_strerror(iRet));
... ...
@@ -220,7 +220,7 @@ static int mod_init(void)
220 220
 	}
221 221
   	/* some servers don't like requests that are made without a user-agent
222 222
 	   field, so we provide one */
223
-	if ((iRet=curl_easy_setopt(glb_hcurl, CURLOPT_USERAGENT, "ser-agent/1.0"))!=0) {
223
+	if ((iRet=curl_easy_setopt(glb_hcurl, CURLOPT_USERAGENT, NAME "-Agent/1.0"))!=0) {
224 224
 		LOG(L_WARN,
225 225
 			"AUTH_IDENTITY:mod_init: Unable to set cURL useragent option: %s\n",
226 226
 			curl_easy_strerror(iRet));