diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-12 14:42:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-12 14:42:03 +0000 |
commit | e5a68574ecfc990eedae657c74e54dda3d96f599 (patch) | |
tree | 55a0851b1eb2249b22fefee353d436d377122bfa | |
parent | b0fdd8eba09319b893fab2dd4945d6dab9cd704c (diff) | |
download | gnunet-e5a68574ecfc990eedae657c74e54dda3d96f599.tar.gz gnunet-e5a68574ecfc990eedae657c74e54dda3d96f599.zip |
track cont
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 8290ccc7e..c833f6085 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -67,6 +67,16 @@ struct MessageQueue | |||
67 | struct MessageQueue *prev; | 67 | struct MessageQueue *prev; |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * Function to call once we're done. | ||
71 | */ | ||
72 | GST_NeighbourSendContinuation cont; | ||
73 | |||
74 | /** | ||
75 | * Closure for 'cont' | ||
76 | */ | ||
77 | void *cont_cls; | ||
78 | |||
79 | /** | ||
70 | * The message(s) we want to transmit, GNUNET_MessageHeader(s) | 80 | * The message(s) we want to transmit, GNUNET_MessageHeader(s) |
71 | * stuck together in memory. Allocated at the end of this struct. | 81 | * stuck together in memory. Allocated at the end of this struct. |
72 | */ | 82 | */ |
@@ -78,32 +88,10 @@ struct MessageQueue | |||
78 | size_t message_buf_size; | 88 | size_t message_buf_size; |
79 | 89 | ||
80 | /** | 90 | /** |
81 | * Client responsible for queueing the message; used to check that a | ||
82 | * client has no two messages pending for the same target and to | ||
83 | * notify the client of a successful transmission; NULL if this is | ||
84 | * an internal message. | ||
85 | */ | ||
86 | struct TransportClient *client; | ||
87 | |||
88 | /** | ||
89 | * At what time should we fail? | 91 | * At what time should we fail? |
90 | */ | 92 | */ |
91 | struct GNUNET_TIME_Absolute timeout; | 93 | struct GNUNET_TIME_Absolute timeout; |
92 | 94 | ||
93 | /** | ||
94 | * Internal message of the transport system that should not be | ||
95 | * included in the usual SEND-SEND_OK transmission confirmation | ||
96 | * traffic management scheme. Typically, "internal_msg" will | ||
97 | * be set whenever "client" is NULL (but it is not strictly | ||
98 | * required). | ||
99 | */ | ||
100 | int internal_msg; | ||
101 | |||
102 | /** | ||
103 | * How important is the message? | ||
104 | */ | ||
105 | unsigned int priority; | ||
106 | |||
107 | }; | 95 | }; |
108 | 96 | ||
109 | 97 | ||
@@ -207,7 +195,7 @@ struct NeighbourMapEntry | |||
207 | * Have we seen an PONG from this neighbour in the past (and | 195 | * Have we seen an PONG from this neighbour in the past (and |
208 | * not had a disconnect since)? | 196 | * not had a disconnect since)? |
209 | */ | 197 | */ |
210 | int received_pong; | 198 | // int received_pong; |
211 | 199 | ||
212 | /** | 200 | /** |
213 | * Do we have a valid public key for this neighbour? | 201 | * Do we have a valid public key for this neighbour? |
@@ -217,7 +205,7 @@ struct NeighbourMapEntry | |||
217 | /** | 205 | /** |
218 | * Are we already in the process of disconnecting this neighbour? | 206 | * Are we already in the process of disconnecting this neighbour? |
219 | */ | 207 | */ |
220 | int in_disconnect; | 208 | // int in_disconnect; |
221 | 209 | ||
222 | /** | 210 | /** |
223 | * Do we currently consider this neighbour connected? (as far as | 211 | * Do we currently consider this neighbour connected? (as far as |
@@ -471,7 +459,6 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
471 | 459 | ||
472 | /** | 460 | /** |
473 | * Try to connect to the target peer using the given address | 461 | * Try to connect to the target peer using the given address |
474 | * (if is valid). | ||
475 | * | 462 | * |
476 | * @param cls the 'struct NeighbourMapEntry' of the target | 463 | * @param cls the 'struct NeighbourMapEntry' of the target |
477 | * @param public_key public key for the peer, never NULL | 464 | * @param public_key public key for the peer, never NULL |
@@ -641,6 +628,8 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | |||
641 | msg_size, | 628 | msg_size, |
642 | GNUNET_NO); | 629 | GNUNET_NO); |
643 | mq = GNUNET_malloc (sizeof (struct MessageQueue) + msg_size); | 630 | mq = GNUNET_malloc (sizeof (struct MessageQueue) + msg_size); |
631 | mq->cont = cont; | ||
632 | mq->cont_cls = cont_cls; | ||
644 | /* FIXME: this memcpy can be up to 7% of our total runtime! */ | 633 | /* FIXME: this memcpy can be up to 7% of our total runtime! */ |
645 | memcpy (&mq[1], msg, msg_size); | 634 | memcpy (&mq[1], msg, msg_size); |
646 | mq->message_buf = (const char*) &mq[1]; | 635 | mq->message_buf = (const char*) &mq[1]; |