diff options
Diffstat (limited to 'src/transport/gnunet-transport-connect-running-peers.c')
-rw-r--r-- | src/transport/gnunet-transport-connect-running-peers.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/transport/gnunet-transport-connect-running-peers.c b/src/transport/gnunet-transport-connect-running-peers.c index a0e3b93a2..172f34b27 100644 --- a/src/transport/gnunet-transport-connect-running-peers.c +++ b/src/transport/gnunet-transport-connect-running-peers.c | |||
@@ -174,24 +174,23 @@ sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
174 | "Press <q> to quit or <1> to send from p1 to p2, <2> to send from p2 to p1, <enter> repeat\n"); | 174 | "Press <q> to quit or <1> to send from p1 to p2, <2> to send from p2 to p1, <enter> repeat\n"); |
175 | 175 | ||
176 | read: | 176 | read: |
177 | t = getchar(); | 177 | t = getchar (); |
178 | if (t == '1') | 178 | if (t == '1') |
179 | { | 179 | { |
180 | th = GNUNET_TRANSPORT_notify_transmit_ready (p1->th, &p2->id, 256, 0, TIMEOUT, | 180 | th = GNUNET_TRANSPORT_notify_transmit_ready (p1->th, &p2->id, 256, 0, |
181 | ¬ify_ready, p1); | 181 | TIMEOUT, ¬ify_ready, p1); |
182 | return; | 182 | return; |
183 | } | 183 | } |
184 | if (t == '2') | 184 | if (t == '2') |
185 | { | 185 | { |
186 | th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, 256, 0, TIMEOUT, | 186 | th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, 256, 0, |
187 | ¬ify_ready, p2); | 187 | TIMEOUT, ¬ify_ready, p2); |
188 | return; | 188 | return; |
189 | } | 189 | } |
190 | if (t == 'q') | 190 | if (t == 'q') |
191 | { | 191 | { |
192 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 192 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Exiting %c!\n", t); |
193 | "Exiting %c!\n", t); | 193 | GNUNET_SCHEDULER_add_now (&end, NULL); |
194 | GNUNET_SCHEDULER_add_now(&end, NULL); | ||
195 | return; | 194 | return; |
196 | } | 195 | } |
197 | goto read; | 196 | goto read; |
@@ -200,8 +199,7 @@ read: | |||
200 | static void | 199 | static void |
201 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | 200 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, |
202 | const struct GNUNET_MessageHeader *message, | 201 | const struct GNUNET_MessageHeader *message, |
203 | const struct GNUNET_ATS_Information *ats, | 202 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
204 | uint32_t ats_count) | ||
205 | { | 203 | { |
206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 204 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
207 | "Received message of type %d from peer %s!\n", | 205 | "Received message of type %d from peer %s!\n", |
@@ -210,8 +208,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
210 | if ((MTYPE == ntohs (message->type)) && | 208 | if ((MTYPE == ntohs (message->type)) && |
211 | (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size))) | 209 | (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size))) |
212 | { | 210 | { |
213 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 211 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully received message\n"); |
214 | "Successfully received message\n"); | ||
215 | 212 | ||
216 | send_task = GNUNET_SCHEDULER_add_now (&sendtask, NULL); | 213 | send_task = GNUNET_SCHEDULER_add_now (&sendtask, NULL); |
217 | } | 214 | } |
@@ -219,8 +216,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
219 | 216 | ||
220 | static void | 217 | static void |
221 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | 218 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, |
222 | const struct GNUNET_ATS_Information *ats, | 219 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
223 | uint32_t ats_count) | ||
224 | { | 220 | { |
225 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n", | 221 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n", |
226 | GNUNET_i2s (peer), cls); | 222 | GNUNET_i2s (peer), cls); |