From 40cbdef8475076515d30be35dfc54c70896eafab Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 22 Jan 2008 09:34:03 +0100 Subject: [PATCH] apache plugin: Do not initialize the plugin if no URL has been specified. There is no need to initialize curl, if the plugin will not be used anyway. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/apache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apache.c b/src/apache.c index 2365d1ff..5a3272f8 100644 --- a/src/apache.c +++ b/src/apache.c @@ -102,6 +102,9 @@ static int init (void) { static char credentials[1024]; + if (url == NULL) + return (0); + if (curl != NULL) { curl_easy_cleanup (curl); @@ -128,10 +131,7 @@ static int init (void) curl_easy_setopt (curl, CURLOPT_USERPWD, credentials); } - if (url != NULL) - { - curl_easy_setopt (curl, CURLOPT_URL, url); - } + curl_easy_setopt (curl, CURLOPT_URL, url); if (cacert != NULL) { -- 2.11.0