added logging
authort3sserakt <t3ss@posteo.de>
Mon, 23 Oct 2017 02:16:43 +0000 (04:16 +0200)
committert3sserakt <t3ss@posteo.de>
Mon, 23 Oct 2017 02:16:43 +0000 (04:16 +0200)
src/social/social_api.c
src/util/client.c

index 4b3655de4d22d1f4576e1b25a6adc39f99d61654..923ab5e33b3b0c2743aea54f1b22c342eca6e12b 100644 (file)
@@ -1082,9 +1082,11 @@ place_cleanup (struct GNUNET_SOCIAL_Place *plc)
 void
 place_disconnect (struct GNUNET_SOCIAL_Place *plc)
 {
+  struct GNUNET_HashCode place_pub_hash;
+  GNUNET_CRYPTO_hash (&plc->pub_key, sizeof (plc->pub_key), &place_pub_hash);
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "place_disconnect, plc = %p\n",
-              plc);
+              "place_disconnect, plc = %s\n",
+              GNUNET_h2s (&place_pub_hash));
   if (NULL != plc->mq)
   {
     struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
index 3d74bff33ec5aaecc3b719ddf00103e9fd6b89a9..90bc837d73e62cf11f9d19518013fc2fbdc3fbc1 100644 (file)
@@ -267,8 +267,13 @@ transmit_ready (void *cls)
                                     len - cstate->msg_off);
   if (-1 == ret)
   {
-    if (EINTR == errno)
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "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));
       goto RETRY;
+    }
     GNUNET_MQ_inject_error (cstate->mq,
                             GNUNET_MQ_ERROR_WRITE);
     return;
@@ -277,6 +282,8 @@ 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));
     cstate->send_task
       = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                         cstate->sock,
@@ -286,6 +293,8 @@ 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));
   cstate->msg = NULL;
   GNUNET_MQ_impl_send_continue (cstate->mq);
 }
@@ -794,8 +803,11 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq,
   GNUNET_assert (NULL == cstate->send_task);
   cstate->msg = msg;
   cstate->msg_off = 0;
-  if (NULL == cstate->sock)
+  if (NULL == cstate->sock){
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "client: waiting for socket\n");
     return; /* still waiting for connection */
+   }
   cstate->send_task
     = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                       cstate->sock,