aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_quota_compliance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_quota_compliance.c')
-rw-r--r--src/transport/test_quota_compliance.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index b53bda514..d01d335f8 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -209,23 +209,29 @@ get_size (unsigned int iter)
209 209
210 210
211static void 211static void
212notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, 212notify_receive (void *cls,
213 const struct GNUNET_PeerIdentity *peer,
213 const struct GNUNET_MessageHeader *message) 214 const struct GNUNET_MessageHeader *message)
214{ 215{
215 const struct TestMessage *hdr; 216 const struct TestMessage *hdr;
217 struct PeerContext *p = cls;
216 218
217 hdr = (const struct TestMessage *) message; 219 hdr = (const struct TestMessage *) message;
218 if (MTYPE != ntohs (message->type)) 220 if (MTYPE != ntohs (message->type))
219 return; 221 return;
220 222
221 struct PeerContext *p = cls; 223 {
222 char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); 224 char *ps = GNUNET_strdup (GNUNET_i2s (&p->id));
223 225
224 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 226 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
225 "Peer %u (`%s') got message %u of size %u from peer (`%s')\n", 227 "Peer %u (`%s') got message %u of size %u from peer (`%s')\n",
226 p->no, ps, ntohl (hdr->num), ntohs (message->size), 228 p->no,
227 GNUNET_i2s (peer)); 229 ps,
228 GNUNET_free (ps); 230 ntohl (hdr->num),
231 ntohs (message->size),
232 GNUNET_i2s (peer));
233 GNUNET_free (ps);
234 }
229} 235}
230 236
231 237
@@ -315,8 +321,10 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
315 321
316 struct PeerContext *p = cls; 322 struct PeerContext *p = cls;
317 323
318 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s') connected to us!\n", 324 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
319 p->no, GNUNET_i2s (peer)); 325 "Peer %u (`%4s') connected to us!\n",
326 p->no,
327 GNUNET_i2s (peer));
320} 328}
321 329
322 330
@@ -325,7 +333,9 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
325{ 333{
326 struct PeerContext *p = cls; 334 struct PeerContext *p = cls;
327 335
328 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s') disconnected!\n", p->no, 336 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
337 "Peer %u (`%4s') disconnected!\n",
338 p->no,
329 GNUNET_i2s (peer)); 339 GNUNET_i2s (peer));
330 if (th != NULL) 340 if (th != NULL)
331 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); 341 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);