diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-20 19:53:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-20 19:53:24 +0000 |
commit | 03f0ae4bb10cf55bb9bab601d45fd96c2eb13603 (patch) | |
tree | 9089fc11319e7de97c43d2e0bf8e6d9b67836b92 /src/transport/test_transport_api_manipulation_send_tcp.c | |
parent | 450982bb56fde81bd512cb21360b809482caf19b (diff) | |
download | gnunet-03f0ae4bb10cf55bb9bab601d45fd96c2eb13603.tar.gz gnunet-03f0ae4bb10cf55bb9bab601d45fd96c2eb13603.zip |
migrating transport service to new MQ API
Diffstat (limited to 'src/transport/test_transport_api_manipulation_send_tcp.c')
-rw-r--r-- | src/transport/test_transport_api_manipulation_send_tcp.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c index fbb7ccbdb..602d4d277 100644 --- a/src/transport/test_transport_api_manipulation_send_tcp.c +++ b/src/transport/test_transport_api_manipulation_send_tcp.c | |||
@@ -59,6 +59,16 @@ do_free (void *cls) | |||
59 | 59 | ||
60 | 60 | ||
61 | static void | 61 | static void |
62 | delayed_transmit (void *cls) | ||
63 | { | ||
64 | struct GNUNET_TRANSPORT_TESTING_SendClosure *sc = cls; | ||
65 | |||
66 | start_delayed = GNUNET_TIME_absolute_get (); | ||
67 | GNUNET_TRANSPORT_TESTING_large_send (sc); | ||
68 | } | ||
69 | |||
70 | |||
71 | static void | ||
62 | sendtask (void *cls) | 72 | sendtask (void *cls) |
63 | { | 73 | { |
64 | struct GNUNET_TRANSPORT_TESTING_SendClosure *sc; | 74 | struct GNUNET_TRANSPORT_TESTING_SendClosure *sc; |
@@ -76,14 +86,20 @@ sendtask (void *cls) | |||
76 | } | 86 | } |
77 | if (1 == messages_recv) | 87 | if (1 == messages_recv) |
78 | { | 88 | { |
79 | memset (&prop, 0, sizeof (prop)); | 89 | memset (&prop, |
90 | 0, | ||
91 | sizeof (prop)); | ||
80 | delay = GNUNET_TIME_UNIT_SECONDS; | 92 | delay = GNUNET_TIME_UNIT_SECONDS; |
81 | GNUNET_TRANSPORT_manipulation_set (ccc->p[0]->tmh, | 93 | GNUNET_TRANSPORT_manipulation_set (ccc->p[0]->tmh, |
82 | &ccc->p[1]->id, | 94 | &ccc->p[1]->id, |
83 | &prop, | 95 | &prop, |
84 | GNUNET_TIME_UNIT_ZERO, | 96 | GNUNET_TIME_UNIT_ZERO, |
85 | delay); | 97 | delay); |
86 | start_delayed = GNUNET_TIME_absolute_get(); | 98 | /* wait 1s to allow manipulation to go into effect */ |
99 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | ||
100 | &delayed_transmit, | ||
101 | sc); | ||
102 | return; | ||
87 | } | 103 | } |
88 | GNUNET_TRANSPORT_TESTING_large_send (sc); | 104 | GNUNET_TRANSPORT_TESTING_large_send (sc); |
89 | } | 105 | } |
@@ -120,7 +136,7 @@ notify_receive (void *cls, | |||
120 | if (0 == messages_recv) | 136 | if (0 == messages_recv) |
121 | { | 137 | { |
122 | /* Received non-delayed message */ | 138 | /* Received non-delayed message */ |
123 | dur_normal = GNUNET_TIME_absolute_get_duration(start_normal); | 139 | dur_normal = GNUNET_TIME_absolute_get_duration (start_normal); |
124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 140 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
125 | "Received non-delayed message %u after %s\n", | 141 | "Received non-delayed message %u after %s\n", |
126 | messages_recv, | 142 | messages_recv, |