-indentation
[oweals/gnunet.git] / src / transport / plugin_transport_http_client.c
index b7fbd3e8793ffab5b5e9829c346592f121f8c434..7da92c7430f25e2fbc50347ce5a7237396354dfc 100644 (file)
@@ -1185,25 +1185,31 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       GNUNET_assert (s != NULL);
       if (msg->msg == CURLMSG_DONE)
       {
-        curl_easy_getinfo (easy_h, CURLINFO_RESPONSE_CODE, &http_statuscode);
+        GNUNET_break (CURLE_OK == curl_easy_getinfo (easy_h,
+            CURLINFO_RESPONSE_CODE, &http_statuscode));
         if (easy_h == s->client_put)
         {
             if  ((0 != msg->data.result) || (http_statuscode != 200))
             {
-                GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
-                  "Session %p/connection %p: PUT connection to `%s' ended with status %i reason %i: `%s'\n",
-                  s, msg->easy_handle, GNUNET_i2s (&s->target),
-                  http_statuscode,
-                  msg->data.result,
-                  curl_easy_strerror (msg->data.result));
+                GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                                 plugin->name,
+                                 "Session %p/connection %p: PUT connection to `%s' ended with status %i reason %i: `%s'\n",
+                                 s, msg->easy_handle,
+                                 GNUNET_i2s (&s->target),
+                                 http_statuscode,
+                                 msg->data.result,
+                                 curl_easy_strerror (msg->data.result));
             }
             else
-              GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
-                "Session %p/connection %p: PUT connection to `%s' ended normal\n",
-                s, msg->easy_handle, GNUNET_i2s (&s->target));
-            if (s->client_get == NULL)
+              GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                               plugin->name,
+                               "Session %p/connection %p: PUT connection to `%s' ended normal\n",
+                               s, msg->easy_handle,
+                               GNUNET_i2s (&s->target));
+            if (NULL == s->client_get)
             {
               /* Disconnect other transmission direction and tell transport */
+              /* FIXME? */
             }
             curl_multi_remove_handle (plugin->curl_multi_handle, easy_h);
             curl_easy_cleanup (easy_h);
@@ -1395,11 +1401,11 @@ client_connect_put (struct Session *s)
       curl_easy_setopt (s->client_put, CURLOPT_SSL_VERIFYHOST, 0);
     }
   }
-  curl_easy_setopt (s->client_get, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
-  curl_easy_setopt (s->client_get, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
+  curl_easy_setopt (s->client_put, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
+  curl_easy_setopt (s->client_put, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
 #else
-  curl_easy_setopt (s->client_get, CURLOPT_PROTOCOLS, CURLPROTO_HTTP);
-  curl_easy_setopt (s->client_get, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP);
+  curl_easy_setopt (s->client_put, CURLOPT_PROTOCOLS, CURLPROTO_HTTP);
+  curl_easy_setopt (s->client_put, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP);
 #endif
   if (s->plugin->proxy_hostname != NULL)
   {
@@ -1882,7 +1888,7 @@ client_configure_plugin (struct HTTP_Client_Plugin *plugin)
     }
 
     /* proxy http tunneling */
-    if (GNUNET_SYSERR == (plugin->proxy_use_httpproxytunnel == GNUNET_CONFIGURATION_get_value_yesno (plugin->env->cfg,
+    if (GNUNET_SYSERR == (plugin->proxy_use_httpproxytunnel = GNUNET_CONFIGURATION_get_value_yesno (plugin->env->cfg,
         plugin->name, "PROXY_HTTP_TUNNELING")))
       plugin->proxy_use_httpproxytunnel = GNUNET_NO;