Merge branch 'fix_social' of gnunet.org:gnunet into fix_social
authort3sserakt <t3ss@posteo.de>
Wed, 22 Nov 2017 16:28:24 +0000 (17:28 +0100)
committert3sserakt <t3ss@posteo.de>
Wed, 22 Nov 2017 16:28:24 +0000 (17:28 +0100)
src/util/client.c
src/util/mq.c

index 138b1cfddb0351d51cace8b5519058d506dad67e..19ab67f0adeb5bac75640b7f7cd518e0a27845ae 100644 (file)
@@ -261,17 +261,25 @@ transmit_ready (void *cls)
   pos = (const char *) cstate->msg;
   len = ntohs (cstate->msg->size);
   GNUNET_assert (cstate->msg_off < len);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "client: message of type %u trying to send with socket %p (MQ: %p\n",
+              ntohs(cstate->msg->type),
+              cstate->sock,
+              cstate->mq);
+
  RETRY:
   ret = GNUNET_NETWORK_socket_send (cstate->sock,
                                     &pos[cstate->msg_off],
                                     len - cstate->msg_off);
   if (-1 == ret)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "client: error during sending message of type %u\n", ntohs(cstate->msg->type));
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "client: error during sending message of type %u\n",
+                ntohs(cstate->msg->type));
     if (EINTR == errno){
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "client: retrying message of type %u\n", ntohs(cstate->msg->type));
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "client: retrying message of type %u\n",
+                  ntohs(cstate->msg->type));
       goto RETRY;
     }
     GNUNET_MQ_inject_error (cstate->mq,
@@ -282,8 +290,9 @@ transmit_ready (void *cls)
   cstate->msg_off += ret;
   if (cstate->msg_off < len)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "client: rescheduling message of type %u\n", ntohs(cstate->msg->type));
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "client: rescheduling message of type %u\n",
+                ntohs(cstate->msg->type));
     cstate->send_task
       = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                         cstate->sock,
@@ -293,8 +302,9 @@ transmit_ready (void *cls)
       GNUNET_MQ_impl_send_in_flight (cstate->mq);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "client: sending message of type %u successful\n", ntohs(cstate->msg->type));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "client: sending message of type %u successful\n",
+              ntohs(cstate->msg->type));
   cstate->msg = NULL;
   GNUNET_MQ_impl_send_continue (cstate->mq);
 }
@@ -382,8 +392,12 @@ connection_client_destroy_impl (struct GNUNET_MQ_Handle *mq,
     GNUNET_SCHEDULER_cancel (cstate->recv_task);
   if (NULL != cstate->retry_task)
     GNUNET_SCHEDULER_cancel (cstate->retry_task);
-  if (NULL != cstate->sock)
+  if (NULL != cstate->sock){
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "client: destroying socket: %p\n",
+                cstate->sock);
     GNUNET_NETWORK_socket_close (cstate->sock);
+  }
   cancel_aps (cstate);
   GNUNET_free (cstate->service_name);
   GNUNET_free_non_null (cstate->hostname);
@@ -522,6 +536,11 @@ try_unixpath (const char *service_name,
     sock = GNUNET_NETWORK_socket_create (AF_UNIX,
                                          SOCK_STREAM,
                                          0);
+
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "client: socket created: %p\n",
+                sock);
+
     if ( (NULL != sock) &&
          ( (GNUNET_OK ==
             GNUNET_NETWORK_socket_connect (sock,
@@ -806,8 +825,9 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq,
   cstate->msg = msg;
   cstate->msg_off = 0;
   if (NULL == cstate->sock){
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "client: waiting for socket\n");
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "client: message of type %u waiting for socket\n",
+                ntohs(msg->type));
     return; /* still waiting for connection */
    }
   cstate->send_task
index 6ad6b82eb21c2bf3030fa767a3b4ce427250ae48..793fd70aeccd2c870eba51919501e565bbe151fc 100644 (file)
@@ -360,7 +360,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
   GNUNET_assert (NULL == mq->envelope_head);
   mq->current_envelope = ev;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "mq: sending message of type %u, queue empty\n",
               ntohs(ev->mh->type));
 
@@ -460,8 +460,9 @@ impl_send_continue (void *cls)
                               mq->envelope_tail,
                               mq->current_envelope);
 
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "mq: sending message of type %u from queue\n", ntohs(mq->current_envelope->mh->type));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "mq: sending message of type %u from queue\n",
+              ntohs(mq->current_envelope->mh->type));
 
   mq->send_impl (mq,
                 mq->current_envelope->mh,
@@ -946,8 +947,9 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
                                    mq->envelope_tail,
                                    mq->current_envelope);
 
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "mq: sending canceled message of type %u queue\n", ntohs(ev->mh->type));
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "mq: sending canceled message of type %u queue\n",
+                  ntohs(ev->mh->type));
 
       mq->send_impl (mq,
                     mq->current_envelope->mh,