diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-16 11:20:27 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-16 11:20:27 +0000 |
commit | 77990e170e992a745b7edde92fbb705247ab83e8 (patch) | |
tree | 5e686547c9bb6d8a752a00c08616a79e872cb8db /src/transport/gnunet-service-transport_neighbours.c | |
parent | 15f8a6f2e023e9da4b41153ecb3fafda2e23cfe7 (diff) | |
download | gnunet-77990e170e992a745b7edde92fbb705247ab83e8.tar.gz gnunet-77990e170e992a745b7edde92fbb705247ab83e8.zip |
overhead reporting
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index da42b8c56..00ce6e5a0 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -862,7 +862,7 @@ free_neighbour (struct NeighbourMapEntry *n, int keep_sessions) | |||
862 | { | 862 | { |
863 | GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); | 863 | GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); |
864 | if (NULL != mq->cont) | 864 | if (NULL != mq->cont) |
865 | mq->cont (mq->cont_cls, GNUNET_SYSERR); | 865 | mq->cont (mq->cont_cls, GNUNET_SYSERR, mq->message_buf_size, 0); |
866 | GNUNET_free (mq); | 866 | GNUNET_free (mq); |
867 | } | 867 | } |
868 | /* It is too late to send other peer disconnect notifications, but at | 868 | /* It is too late to send other peer disconnect notifications, but at |
@@ -955,7 +955,7 @@ send_with_session (struct NeighbourMapEntry *n, | |||
955 | timeout, | 955 | timeout, |
956 | cont, cont_cls)))) && | 956 | cont, cont_cls)))) && |
957 | (NULL != cont)) | 957 | (NULL != cont)) |
958 | cont (cont_cls, &n->id, GNUNET_SYSERR); | 958 | cont (cont_cls, &n->id, GNUNET_SYSERR, msgbuf_size, 0); |
959 | GNUNET_break (NULL != papi); | 959 | GNUNET_break (NULL != papi); |
960 | } | 960 | } |
961 | 961 | ||
@@ -983,7 +983,7 @@ master_task (void *cls, | |||
983 | */ | 983 | */ |
984 | static void | 984 | static void |
985 | send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target, | 985 | send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target, |
986 | int result) | 986 | int result, size_t payload, size_t physical) |
987 | { | 987 | { |
988 | struct NeighbourMapEntry *n; | 988 | struct NeighbourMapEntry *n; |
989 | 989 | ||
@@ -1130,7 +1130,7 @@ disconnect_neighbour (struct NeighbourMapEntry *n) | |||
1130 | static void | 1130 | static void |
1131 | transmit_send_continuation (void *cls, | 1131 | transmit_send_continuation (void *cls, |
1132 | const struct GNUNET_PeerIdentity *receiver, | 1132 | const struct GNUNET_PeerIdentity *receiver, |
1133 | int success) | 1133 | int success, size_t size_payload, size_t physical) |
1134 | { | 1134 | { |
1135 | struct MessageQueue *mq = cls; | 1135 | struct MessageQueue *mq = cls; |
1136 | struct NeighbourMapEntry *n; | 1136 | struct NeighbourMapEntry *n; |
@@ -1150,6 +1150,7 @@ transmit_send_continuation (void *cls, | |||
1150 | n->task = GNUNET_SCHEDULER_add_now (&master_task, n); | 1150 | n->task = GNUNET_SCHEDULER_add_now (&master_task, n); |
1151 | } | 1151 | } |
1152 | GNUNET_assert (bytes_in_send_queue >= mq->message_buf_size); | 1152 | GNUNET_assert (bytes_in_send_queue >= mq->message_buf_size); |
1153 | GNUNET_break (size_payload == mq->message_buf_size); | ||
1153 | bytes_in_send_queue -= mq->message_buf_size; | 1154 | bytes_in_send_queue -= mq->message_buf_size; |
1154 | GNUNET_STATISTICS_set (GST_stats, | 1155 | GNUNET_STATISTICS_set (GST_stats, |
1155 | gettext_noop | 1156 | gettext_noop |
@@ -1171,7 +1172,7 @@ transmit_send_continuation (void *cls, | |||
1171 | ntohs (((struct GNUNET_MessageHeader *) mq->message_buf)->type), | 1172 | ntohs (((struct GNUNET_MessageHeader *) mq->message_buf)->type), |
1172 | (success == GNUNET_OK) ? "success" : "FAILURE"); | 1173 | (success == GNUNET_OK) ? "success" : "FAILURE"); |
1173 | if (NULL != mq->cont) | 1174 | if (NULL != mq->cont) |
1174 | mq->cont (mq->cont_cls, success); | 1175 | mq->cont (mq->cont_cls, success, size_payload, physical); |
1175 | GNUNET_free (mq); | 1176 | GNUNET_free (mq); |
1176 | } | 1177 | } |
1177 | 1178 | ||
@@ -1224,7 +1225,7 @@ try_transmission_to_peer (struct NeighbourMapEntry *n) | |||
1224 | 1, GNUNET_NO); | 1225 | 1, GNUNET_NO); |
1225 | GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); | 1226 | GNUNET_CONTAINER_DLL_remove (n->messages_head, n->messages_tail, mq); |
1226 | n->is_active = mq; | 1227 | n->is_active = mq; |
1227 | transmit_send_continuation (mq, &n->id, GNUNET_SYSERR); /* timeout */ | 1228 | transmit_send_continuation (mq, &n->id, GNUNET_SYSERR, mq->message_buf_size, 0); /* timeout */ |
1228 | } | 1229 | } |
1229 | if (NULL == mq) | 1230 | if (NULL == mq) |
1230 | return; /* no more messages */ | 1231 | return; /* no more messages */ |
@@ -1477,14 +1478,14 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, | |||
1477 | { | 1478 | { |
1478 | GNUNET_break (0); | 1479 | GNUNET_break (0); |
1479 | if (NULL != cont) | 1480 | if (NULL != cont) |
1480 | cont (cont_cls, GNUNET_SYSERR); | 1481 | cont (cont_cls, GNUNET_SYSERR, msg_size, 0); |
1481 | return; | 1482 | return; |
1482 | } | 1483 | } |
1483 | if (GNUNET_YES != test_connected (n)) | 1484 | if (GNUNET_YES != test_connected (n)) |
1484 | { | 1485 | { |
1485 | GNUNET_break (0); | 1486 | GNUNET_break (0); |
1486 | if (NULL != cont) | 1487 | if (NULL != cont) |
1487 | cont (cont_cls, GNUNET_SYSERR); | 1488 | cont (cont_cls, GNUNET_SYSERR, msg_size, 0); |
1488 | return; | 1489 | return; |
1489 | } | 1490 | } |
1490 | bytes_in_send_queue += msg_size; | 1491 | bytes_in_send_queue += msg_size; |