diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-02-04 11:15:11 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-02-04 11:15:11 +0000 |
commit | 3943da8a6cdb1f8f67b6f66e7911620e6ecdbe41 (patch) | |
tree | 34c056cc87ce64cb0f57db130f21d043c33051b3 /src | |
parent | 4a091fe51761db20dea1a3325dfff89209e907b4 (diff) | |
download | gnunet-3943da8a6cdb1f8f67b6f66e7911620e6ecdbe41.tar.gz gnunet-3943da8a6cdb1f8f67b6f66e7911620e6ecdbe41.zip |
received ack removal
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 9 | ||||
-rw-r--r-- | src/transport/transport_api.c | 34 |
2 files changed, 26 insertions, 17 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index f43094499..e0802c758 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -2186,6 +2186,15 @@ process_hello (struct TransportPlugin *plugin, | |||
2186 | "Processing `%s' message for `%4s' of size %d (hsize is %d)\n", | 2186 | "Processing `%s' message for `%4s' of size %d (hsize is %d)\n", |
2187 | "HELLO", GNUNET_i2s (&target), GNUNET_HELLO_size(hello), hsize); | 2187 | "HELLO", GNUNET_i2s (&target), GNUNET_HELLO_size(hello), hsize); |
2188 | #endif | 2188 | #endif |
2189 | |||
2190 | #if DEBUG_TRANSPORT | ||
2191 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2192 | "Notifying peerinfo about peer %s\n", | ||
2193 | GNUNET_i2s (&target)); | ||
2194 | #endif | ||
2195 | /* For some reason the line below causes something to hang up... maybe peerinfo isn't ready yet? */ | ||
2196 | /*GNUNET_PEERINFO_add_peer (cfg, sched, &target, hello); */ | ||
2197 | |||
2189 | /* check if a HELLO for this peer is already on the validation list */ | 2198 | /* check if a HELLO for this peer is already on the validation list */ |
2190 | e = pending_validations; | 2199 | e = pending_validations; |
2191 | while (e != NULL) | 2200 | while (e != NULL) |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 347842e52..8b4fe3ffd 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -104,6 +104,7 @@ struct NeighbourList | |||
104 | */ | 104 | */ |
105 | int transmit_ok; | 105 | int transmit_ok; |
106 | 106 | ||
107 | #if ACK | ||
107 | /** | 108 | /** |
108 | * Set to GNUNET_YES if we have received an ACK for the | 109 | * Set to GNUNET_YES if we have received an ACK for the |
109 | * given peer. Peers that receive our HELLO always respond | 110 | * given peer. Peers that receive our HELLO always respond |
@@ -114,7 +115,7 @@ struct NeighbourList | |||
114 | * transport API itself). | 115 | * transport API itself). |
115 | */ | 116 | */ |
116 | int received_ack; | 117 | int received_ack; |
117 | 118 | #endif | |
118 | }; | 119 | }; |
119 | 120 | ||
120 | 121 | ||
@@ -1639,7 +1640,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1639 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1640 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1640 | "Do know neighbor, scheduling transmission!\n"); | 1641 | "Do know neighbor, scheduling transmission!\n"); |
1641 | #endif | 1642 | #endif |
1643 | #if ACK | ||
1642 | n->received_ack = GNUNET_YES; | 1644 | n->received_ack = GNUNET_YES; |
1645 | #endif | ||
1643 | if (NULL != n->transmit_handle) | 1646 | if (NULL != n->transmit_handle) |
1644 | { | 1647 | { |
1645 | #if DEBUG_TRANSPORT | 1648 | #if DEBUG_TRANSPORT |
@@ -1736,7 +1739,6 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1736 | GNUNET_SCHEDULER_cancel (h->sched, | 1739 | GNUNET_SCHEDULER_cancel (h->sched, |
1737 | n->transmit_handle->notify_delay_task); | 1740 | n->transmit_handle->notify_delay_task); |
1738 | n->transmit_handle->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; | 1741 | n->transmit_handle->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
1739 | GNUNET_assert (GNUNET_YES == n->received_ack); | ||
1740 | schedule_request (n->transmit_handle); | 1742 | schedule_request (n->transmit_handle); |
1741 | } | 1743 | } |
1742 | break; | 1744 | break; |
@@ -1767,31 +1769,29 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1767 | "Receiving `%s' message from `%4s'.\n", | 1769 | "Receiving `%s' message from `%4s'.\n", |
1768 | "ACK", GNUNET_i2s (&im->peer)); | 1770 | "ACK", GNUNET_i2s (&im->peer)); |
1769 | #endif | 1771 | #endif |
1772 | break; | ||
1773 | default: | ||
1774 | #if DEBUG_TRANSPORT | ||
1775 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1776 | "Received message of type %u from `%4s'.\n", | ||
1777 | ntohs (imm->type), GNUNET_i2s (&im->peer)); | ||
1778 | #endif | ||
1779 | |||
1770 | n = find_neighbour (h, &im->peer); | 1780 | n = find_neighbour (h, &im->peer); |
1771 | if (n == NULL) | 1781 | if (n == NULL) |
1772 | { | 1782 | { |
1773 | GNUNET_break (0); | 1783 | GNUNET_break (0); |
1774 | break; | 1784 | break; |
1775 | } | 1785 | } |
1776 | if (n->received_ack == GNUNET_NO) | 1786 | |
1787 | if (NULL != n->transmit_handle) | ||
1777 | { | 1788 | { |
1778 | n->received_ack = GNUNET_YES; | ||
1779 | if (NULL != n->transmit_handle) | ||
1780 | { | ||
1781 | #if DEBUG_TRANSPORT | 1789 | #if DEBUG_TRANSPORT |
1782 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1790 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1783 | "Peer connected, scheduling delayed message for delivery now.\n"); | 1791 | "Peer connected, scheduling delayed message for delivery now.\n"); |
1784 | #endif | 1792 | #endif |
1785 | schedule_request (n->transmit_handle); | 1793 | schedule_request (n->transmit_handle); |
1786 | } | ||
1787 | } | 1794 | } |
1788 | break; | ||
1789 | default: | ||
1790 | #if DEBUG_TRANSPORT | ||
1791 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1792 | "Received message of type %u from `%4s'.\n", | ||
1793 | ntohs (imm->type), GNUNET_i2s (&im->peer)); | ||
1794 | #endif | ||
1795 | if (h->rec != NULL) | 1795 | if (h->rec != NULL) |
1796 | h->rec (h->cls, &im->peer, imm, | 1796 | h->rec (h->cls, &im->peer, imm, |
1797 | GNUNET_TIME_relative_ntoh (im->latency), ntohs(im->distance)); | 1797 | GNUNET_TIME_relative_ntoh (im->latency), ntohs(im->distance)); |