aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_manipulation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-09-20 19:53:24 +0000
committerChristian Grothoff <christian@grothoff.org>2016-09-20 19:53:24 +0000
commit03f0ae4bb10cf55bb9bab601d45fd96c2eb13603 (patch)
tree9089fc11319e7de97c43d2e0bf8e6d9b67836b92 /src/transport/gnunet-service-transport_manipulation.c
parent450982bb56fde81bd512cb21360b809482caf19b (diff)
downloadgnunet-03f0ae4bb10cf55bb9bab601d45fd96c2eb13603.tar.gz
gnunet-03f0ae4bb10cf55bb9bab601d45fd96c2eb13603.zip
migrating transport service to new MQ API
Diffstat (limited to 'src/transport/gnunet-service-transport_manipulation.c')
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index 1af023d4d..f198d6e49 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -25,8 +25,6 @@
25 * @author Matthias Wachs 25 * @author Matthias Wachs
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet-service-transport_blacklist.h"
29#include "gnunet-service-transport_clients.h"
30#include "gnunet-service-transport_hello.h" 28#include "gnunet-service-transport_hello.h"
31#include "gnunet-service-transport_neighbours.h" 29#include "gnunet-service-transport_neighbours.h"
32#include "gnunet-service-transport_plugins.h" 30#include "gnunet-service-transport_plugins.h"
@@ -170,20 +168,14 @@ static struct GNUNET_SCHEDULER_Task *generic_send_delay_task;
170/** 168/**
171 * Set traffic metric to manipulate 169 * Set traffic metric to manipulate
172 * 170 *
173 * @param cls closure
174 * @param client client sending message
175 * @param message containing information 171 * @param message containing information
176 */ 172 */
177void 173void
178GST_manipulation_set_metric (void *cls, 174GST_manipulation_set_metric (const struct TrafficMetricMessage *tm)
179 struct GNUNET_SERVER_Client *client,
180 const struct GNUNET_MessageHeader *message)
181{ 175{
182 const struct TrafficMetricMessage *tm;
183 static struct GNUNET_PeerIdentity zero; 176 static struct GNUNET_PeerIdentity zero;
184 struct TM_Peer *tmp; 177 struct TM_Peer *tmp;
185 178
186 tm = (const struct TrafficMetricMessage *) message;
187 if (0 == memcmp (&tm->peer, 179 if (0 == memcmp (&tm->peer,
188 &zero, 180 &zero,
189 sizeof(struct GNUNET_PeerIdentity))) 181 sizeof(struct GNUNET_PeerIdentity)))
@@ -192,13 +184,11 @@ GST_manipulation_set_metric (void *cls,
192 "Received traffic metrics for all peers\n"); 184 "Received traffic metrics for all peers\n");
193 delay_in = GNUNET_TIME_relative_ntoh (tm->delay_in); 185 delay_in = GNUNET_TIME_relative_ntoh (tm->delay_in);
194 delay_out = GNUNET_TIME_relative_ntoh (tm->delay_out); 186 delay_out = GNUNET_TIME_relative_ntoh (tm->delay_out);
195 GNUNET_SERVER_receive_done (client,
196 GNUNET_OK);
197 return; 187 return;
198 } 188 }
199 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 189 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
200 "Received traffic metrics for peer `%s'\n", 190 "Received traffic metrics for peer `%s'\n",
201 GNUNET_i2s(&tm->peer)); 191 GNUNET_i2s (&tm->peer));
202 if (NULL == 192 if (NULL ==
203 (tmp = GNUNET_CONTAINER_multipeermap_get (peers, 193 (tmp = GNUNET_CONTAINER_multipeermap_get (peers,
204 &tm->peer))) 194 &tm->peer)))
@@ -214,8 +204,6 @@ GST_manipulation_set_metric (void *cls,
214 &tm->properties); 204 &tm->properties);
215 tmp->delay_in = GNUNET_TIME_relative_ntoh (tm->delay_in); 205 tmp->delay_in = GNUNET_TIME_relative_ntoh (tm->delay_in);
216 tmp->delay_out = GNUNET_TIME_relative_ntoh (tm->delay_out); 206 tmp->delay_out = GNUNET_TIME_relative_ntoh (tm->delay_out);
217 GNUNET_SERVER_receive_done (client,
218 GNUNET_OK);
219} 207}
220 208
221 209
@@ -494,7 +482,9 @@ GST_manipulation_peer_disconnect (const struct GNUNET_PeerIdentity *peer)
494 while (NULL != (dqe = next)) 482 while (NULL != (dqe = next))
495 { 483 {
496 next = dqe->next; 484 next = dqe->next;
497 if (0 == memcmp(peer, &dqe->id, sizeof(dqe->id))) 485 if (0 == memcmp (peer,
486 &dqe->id,
487 sizeof (dqe->id)))
498 { 488 {
499 GNUNET_CONTAINER_DLL_remove (generic_dqe_head, 489 GNUNET_CONTAINER_DLL_remove (generic_dqe_head,
500 generic_dqe_tail, 490 generic_dqe_tail,