added logging
authort3sserakt <t3ss@posteo.de>
Sun, 29 Oct 2017 01:28:16 +0000 (02:28 +0100)
committert3sserakt <t3ss@posteo.de>
Sun, 29 Oct 2017 01:28:16 +0000 (02:28 +0100)
src/util/client.c

index 90bc837d73e62cf11f9d19518013fc2fbdc3fbc1..cf75dffbc8b8628d54270020ec6a83f542b13971 100644 (file)
@@ -261,6 +261,8 @@ 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_WARNING,
+              "client: message of type %u trying to send with socket %p\n", ntohs(cstate->msg->type), cstate->sock);
  RETRY:
   ret = GNUNET_NETWORK_socket_send (cstate->sock,
                                     &pos[cstate->msg_off],
@@ -380,8 +382,11 @@ 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_WARNING,
+                "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);
@@ -520,6 +525,10 @@ try_unixpath (const char *service_name,
     sock = GNUNET_NETWORK_socket_create (AF_UNIX,
                                          SOCK_STREAM,
                                          0);
+
+    GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+                "client: socket created: %p\n", sock);
+
     if ( (NULL != sock) &&
          ( (GNUNET_OK ==
             GNUNET_NETWORK_socket_connect (sock,
@@ -805,7 +814,7 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq,
   cstate->msg_off = 0;
   if (NULL == cstate->sock){
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "client: waiting for socket\n");
+                "client: message of type %u waiting for socket\n",ntohs(msg->type));
     return; /* still waiting for connection */
    }
   cstate->send_task