Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=c41cdfbb4a1c0055b2c4e701d3766fbc89271c3a

commit c41cdfbb4a1c0055b2c4e701d3766fbc89271c3a
Author: Michel Hermier <[email protected]>
Date:   Thu Nov 28 12:35:35 2013 +0100

libpacman: Reindent _pacman_curl_init.

diff --git a/lib/libpacman/server.c b/lib/libpacman/server.c
index 831ff78..fc7310d 100644
--- a/lib/libpacman/server.c
+++ b/lib/libpacman/server.c
@@ -182,33 +182,32 @@ int _pacman_curl_init(pmcurldownloader_t *curldownloader) 
{
_pacman_log(PM_LOG_WARNING, _("fatal error initializing libcurl\n"));
pm_errno = PM_ERR_CONNECT_FAILED;
goto error;
-       } else {
-               if(curl_easy_setopt(curlHandle,CURLOPT_NOPROGRESS , 0) != 
CURLE_OK) {
-                       _pacman_log(PM_LOG_DEBUG, _("error setting noprogress 
off\n"));
-                       goto error;
-               }
-               if(curl_easy_setopt(curlHandle,CURLOPT_PROGRESSDATA , (void 
*)&curldownloader) != CURLE_OK) {
-                       _pacman_log(PM_LOG_DEBUG, _("error passing our debug 
function pointer to progress callback\n"));
+       }
+       if(curl_easy_setopt(curlHandle,CURLOPT_NOPROGRESS , 0) != CURLE_OK) {
+               _pacman_log(PM_LOG_DEBUG, _("error setting noprogress off\n"));
+               goto error;
+       }
+       if(curl_easy_setopt(curlHandle,CURLOPT_PROGRESSDATA , (void 
*)&curldownloader) != CURLE_OK) {
+               _pacman_log(PM_LOG_DEBUG, _("error passing our debug function 
pointer to progress callback\n"));
+               goto error;
+       }
+       if(curl_easy_setopt(curlHandle, CURLOPT_PROGRESSFUNCTION, 
_pacman_curl_progresscb) != CURLE_OK) {
+               _pacman_log(PM_LOG_DEBUG, _("error setting progress bar\n"));
+               goto error;
+       }
+       if(handle->proxyhost) {
+               if(!handle->proxyport) {
+                       _pacman_log(PM_LOG_WARNING, _("pacman proxy setting 
needs a port specified url:port\n"));
+                       pm_errno = PM_ERR_CONNECT_FAILED;
goto error;
}
-               if(curl_easy_setopt(curlHandle, CURLOPT_PROGRESSFUNCTION, 
_pacman_curl_progresscb) != CURLE_OK) {
-                       _pacman_log(PM_LOG_DEBUG, _("error setting progress 
bar\n"));
+               char pacmanProxy[PATH_MAX];
+               sprintf(pacmanProxy, "%s:%d", handle->proxyhost, 
handle->proxyport);
+               if(curl_easy_setopt(curlHandle,CURLOPT_PROXY, pacmanProxy) != 
CURLE_OK) {
+                       _pacman_log(PM_LOG_WARNING, _("error setting proxy\n"));
+                       pm_errno = PM_ERR_CONNECT_FAILED;
goto error;
}
-               if(handle->proxyhost) {
-                       if(!handle->proxyport) {
-                               _pacman_log(PM_LOG_WARNING, _("pacman proxy 
setting needs a port specified url:port\n"));
-                               pm_errno = PM_ERR_CONNECT_FAILED;
-                               goto error;
-                       }
-                       char pacmanProxy[PATH_MAX];
-                       sprintf(pacmanProxy, "%s:%d", handle->proxyhost, 
handle->proxyport);
-                       if(curl_easy_setopt(curlHandle,CURLOPT_PROXY, 
pacmanProxy) != CURLE_OK) {
-                               _pacman_log(PM_LOG_WARNING, _("error setting 
proxy\n"));
-                               pm_errno = PM_ERR_CONNECT_FAILED;
-                               goto error;
-                       }
-               }
}
curldownloader->curl = curlHandle;
return 0;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to