aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2017-11-25 17:22:29 +0100
committert3sserakt <t3ss@posteo.de>2017-11-25 17:22:29 +0100
commit7d957ddfa3ab1a45c38ba3345ef0972748a8a79b (patch)
tree05854b7180bececcb8b764a92039a7ecfb0b1280 /src/util
parent3cde37cf7f33eb992d1c13b383e1f0ddecfbf2da (diff)
downloadgnunet-7d957ddfa3ab1a45c38ba3345ef0972748a8a79b.tar.gz
gnunet-7d957ddfa3ab1a45c38ba3345ef0972748a8a79b.zip
added logging
Diffstat (limited to 'src/util')
-rw-r--r--src/util/client.c3
-rw-r--r--src/util/mq.c7
-rw-r--r--src/util/service.c24
3 files changed, 30 insertions, 4 deletions
diff --git a/src/util/client.c b/src/util/client.c
index ded32f577..e5bf7e176 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -274,7 +274,8 @@ transmit_ready (void *cls)
274 if (-1 == ret) 274 if (-1 == ret)
275 { 275 {
276 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 276 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
277 "client: error during sending message of type %u\n", ntohs(cstate->msg->type)); 277 "client: error during sending message of type %u\n",
278 ntohs(cstate->msg->type));
278 if (EINTR == errno){ 279 if (EINTR == errno){
279 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
280 "client: retrying message of type %u\n", 281 "client: retrying message of type %u\n",
diff --git a/src/util/mq.c b/src/util/mq.c
index 793fd70ae..58aba7797 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -361,8 +361,9 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
361 mq->current_envelope = ev; 361 mq->current_envelope = ev;
362 362
363 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 363 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
364 "mq: sending message of type %u, queue empty\n", 364 "mq: sending message of type %u, queue empty (MQ: %p)\n",
365 ntohs(ev->mh->type)); 365 ntohs(ev->mh->type),
366 mq);
366 367
367 mq->send_impl (mq, 368 mq->send_impl (mq,
368 ev->mh, 369 ev->mh,
@@ -863,7 +864,7 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
863 * are not queued! */ 864 * are not queued! */
864 mq->current_envelope->parent_queue = NULL; 865 mq->current_envelope->parent_queue = NULL;
865 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 866 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
866 "MQ destroy drops message of type %u\n", 867 "MQ destroy drops current message of type %u\n",
867 ntohs (mq->current_envelope->mh->type)); 868 ntohs (mq->current_envelope->mh->type));
868 GNUNET_MQ_discard (mq->current_envelope); 869 GNUNET_MQ_discard (mq->current_envelope);
869 mq->current_envelope = NULL; 870 mq->current_envelope = NULL;
diff --git a/src/util/service.c b/src/util/service.c
index 782adf5c5..b4eb33caa 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1932,6 +1932,11 @@ do_send (void *cls)
1932 size_t left; 1932 size_t left;
1933 const char *buf; 1933 const char *buf;
1934 1934
1935 LOG (GNUNET_ERROR_TYPE_DEBUG,
1936 "service: sending message with type %u",
1937 ntohs(client->msg->type));
1938
1939
1935 client->send_task = NULL; 1940 client->send_task = NULL;
1936 buf = (const char *) client->msg; 1941 buf = (const char *) client->msg;
1937 left = ntohs (client->msg->size) - client->msg_pos; 1942 left = ntohs (client->msg->size) - client->msg_pos;
@@ -1941,6 +1946,8 @@ do_send (void *cls)
1941 GNUNET_assert (ret <= (ssize_t) left); 1946 GNUNET_assert (ret <= (ssize_t) left);
1942 if (0 == ret) 1947 if (0 == ret)
1943 { 1948 {
1949 LOG (GNUNET_ERROR_TYPE_DEBUG,
1950 "no data send");
1944 GNUNET_MQ_inject_error (client->mq, 1951 GNUNET_MQ_inject_error (client->mq,
1945 GNUNET_MQ_ERROR_WRITE); 1952 GNUNET_MQ_ERROR_WRITE);
1946 return; 1953 return;
@@ -1958,6 +1965,9 @@ do_send (void *cls)
1958 if (EPIPE != errno) 1965 if (EPIPE != errno)
1959 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, 1966 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
1960 "send"); 1967 "send");
1968 LOG (GNUNET_ERROR_TYPE_DEBUG,
1969 "socket send returned with error code %i",
1970 errno);
1961 GNUNET_MQ_inject_error (client->mq, 1971 GNUNET_MQ_inject_error (client->mq,
1962 GNUNET_MQ_ERROR_WRITE); 1972 GNUNET_MQ_ERROR_WRITE);
1963 return; 1973 return;
@@ -2518,6 +2528,20 @@ GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c)
2518 "Client dropped: %p (MQ: %p)\n", 2528 "Client dropped: %p (MQ: %p)\n",
2519 c, 2529 c,
2520 c->mq); 2530 c->mq);
2531
2532#if EXECINFO
2533 void *backtrace_array[MAX_TRACE_DEPTH];
2534 int num_backtrace_strings = backtrace (backtrace_array, MAX_TRACE_DEPTH);
2535 char **backtrace_strings =
2536 backtrace_symbols (backtrace_array,
2537 t->num_backtrace_strings);
2538 for (unsigned int i = 0; i < num_backtrace_strings; i++)
2539 LOG (GNUNET_ERROR_TYPE_DEBUG,
2540 "client drop trace %u: %s\n",
2541 i,
2542 backtrace_strings[i]);
2543#endif
2544
2521 if (NULL != c->drop_task) 2545 if (NULL != c->drop_task)
2522 { 2546 {
2523 /* asked to drop twice! */ 2547 /* asked to drop twice! */