aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_tcp.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-08-08 12:16:25 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-08-08 12:16:25 +0000
commite7327a892fae9669b8492e772489917c4f62be0b (patch)
tree76d4d807291ec6e0f16f361a609a4ec2151ed4ca /src/transport/plugin_transport_tcp.c
parent42e009e9502926f3c88f97c5b8e990b07dcd3a30 (diff)
downloadgnunet-e7327a892fae9669b8492e772489917c4f62be0b.tar.gz
gnunet-e7327a892fae9669b8492e772489917c4f62be0b.zip
debugging messages due to mantis bug 2980
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r--src/transport/plugin_transport_tcp.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index bd557b9d1..9d710e523 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -1626,11 +1626,20 @@ struct PrettyPrinterContext
1626}; 1626};
1627 1627
1628 1628
1629
1629void 1630void
1630ppc_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1631ppc_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1631{ 1632{
1632 struct PrettyPrinterContext *ppc = cls; 1633 int count = 0;
1633 /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC %p was not removed!\n", ppc); */ 1634 struct PrettyPrinterContext *ppc = cls;
1635 struct PrettyPrinterContext *cur;
1636 for (cur = ppc_dll_head; (NULL != cur); cur = cur->next)
1637 {
1638 if (cur != ppc)
1639 count++;
1640 }
1641
1642 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cancel request %p, %u pending\n", ppc, count);
1634 ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1643 ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
1635 if (NULL != ppc->resolver_handle) 1644 if (NULL != ppc->resolver_handle)
1636 { 1645 {
@@ -1655,7 +1664,14 @@ append_port (void *cls, const char *hostname)
1655 struct PrettyPrinterContext *ppc = cls; 1664 struct PrettyPrinterContext *ppc = cls;
1656 struct PrettyPrinterContext *cur; 1665 struct PrettyPrinterContext *cur;
1657 char *ret; 1666 char *ret;
1658 /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC callback: %p `%s'\n",ppc, hostname); */ 1667 int count = 0;
1668
1669 for (cur = ppc_dll_head; (NULL != cur); cur = cur->next)
1670 {
1671 if (cur != ppc)
1672 count++;
1673 }
1674 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Callback request %p == %s, %u pending\n", ppc, hostname, count);
1659 if (hostname == NULL) 1675 if (hostname == NULL)
1660 { 1676 {
1661 ppc->asc (ppc->asc_cls, NULL); 1677 ppc->asc (ppc->asc_cls, NULL);
@@ -1663,7 +1679,7 @@ append_port (void *cls, const char *hostname)
1663 GNUNET_SCHEDULER_cancel (ppc->timeout_task); 1679 GNUNET_SCHEDULER_cancel (ppc->timeout_task);
1664 ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1680 ppc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
1665 ppc->resolver_handle = NULL; 1681 ppc->resolver_handle = NULL;
1666 /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC %p was removed!\n", ppc); */ 1682 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Done request %p, %u pending\n", ppc, count);
1667 GNUNET_free (ppc); 1683 GNUNET_free (ppc);
1668 return; 1684 return;
1669 } 1685 }
@@ -1769,10 +1785,18 @@ tcp_plugin_address_pretty_printer (void *cls, const char *type,
1769 ppc->options = options; 1785 ppc->options = options;
1770 ppc->timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(timeout, 2), 1786 ppc->timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(timeout, 2),
1771 &ppc_cancel_task, ppc); 1787 &ppc_cancel_task, ppc);
1772 GNUNET_CONTAINER_DLL_insert (ppc_dll_head, ppc_dll_tail, ppc);
1773 /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "PPC %p was created!\n", ppc); */
1774 ppc->resolver_handle = GNUNET_RESOLVER_hostname_get (sb, sbs, !numeric, 1788 ppc->resolver_handle = GNUNET_RESOLVER_hostname_get (sb, sbs, !numeric,
1775 timeout, &append_port, ppc); 1789 timeout, &append_port, ppc);
1790 if (NULL != ppc->resolver_handle)
1791 {
1792 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Adding request %p\n", ppc);
1793 GNUNET_CONTAINER_DLL_insert (ppc_dll_head, ppc_dll_tail, ppc);
1794 }
1795 else
1796 {
1797 GNUNET_break (0);
1798 GNUNET_free (ppc);
1799 }
1776} 1800}
1777 1801
1778 1802
@@ -2696,7 +2720,8 @@ libgnunet_plugin_transport_tcp_done (void *cls)
2696 { 2720 {
2697 next = cur->next; 2721 next = cur->next;
2698 GNUNET_CONTAINER_DLL_remove (ppc_dll_head, ppc_dll_tail, cur); 2722 GNUNET_CONTAINER_DLL_remove (ppc_dll_head, ppc_dll_tail, cur);
2699 GNUNET_RESOLVER_request_cancel (cur->resolver_handle); 2723 if (NULL != cur->resolver_handle)
2724 GNUNET_RESOLVER_request_cancel (cur->resolver_handle);
2700 GNUNET_SCHEDULER_cancel (cur->timeout_task); 2725 GNUNET_SCHEDULER_cancel (cur->timeout_task);
2701 GNUNET_free (cur); 2726 GNUNET_free (cur);
2702 GNUNET_break (0); 2727 GNUNET_break (0);