fixed coverity bug #10042
[oweals/gnunet.git] / src / transport / plugin_transport_http.c
index f70397dc5fe647929fecf4ec275e88afb6203cd9..d94740654a39e4e77eccc058463d102b48dadc0a 100644 (file)
 #include <curl/curl.h>
 
 #if BUILD_HTTPS
-#define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_gnunet_transport_plugin.https_init
-#define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_gnunet_transport_plugin.https_done
+#define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_https_init
+#define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_https_done
 #define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_https
 #define PROTOCOL_PREFIX "https"
 #else
-#define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_gnunet_transport_plugin.http_init
-#define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_gnunet_transport_plugin.http_done
+#define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_http_init
+#define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_http_done
 #define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_http
 #define PROTOCOL_PREFIX "http"
 #endif
@@ -1589,7 +1589,7 @@ static void curl_receive_mst_cb  (void *cls,
   if (delay.rel_value > 0)
   {
 #if DEBUG_HTTP
-       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.abs_value);
+       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.rel_value);
 #endif
        pc->reset_task = GNUNET_SCHEDULER_add_delayed (delay, &reset_inbound_quota_delay, pc);
   }
@@ -2296,17 +2296,15 @@ http_plugin_send (void *cls,
       if (force_address != GNUNET_YES)
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"No existing connection: creating new session %X to peer %s\n", ps, GNUNET_i2s(target));
 #endif
-      if ((addrlen!=0) && (addr!=NULL))
-      {
-         ps->addr = GNUNET_malloc(addrlen);
-         memcpy(ps->addr,addr,addrlen);
-         ps->addrlen = addrlen;
-      }
+         ps->addr = GNUNET_malloc(addrlen);
+         memcpy(ps->addr,addr,addrlen);
+         ps->addrlen = addrlen;
+      /*
          else
          {
                ps->addr = NULL;
                ps->addrlen = 0;
-         }
+         }*/
          ps->direction=OUTBOUND;
          ps->recv_connected = GNUNET_NO;
          ps->recv_force_disconnect = GNUNET_NO;