- static uint32_t counter;
- char *cbuf = buf;
- struct TestMessage hdr;
-
- th = NULL;
- if (buf == NULL)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Timeout occurred while waiting for transmit_ready for message\n");
- ccc->global_ret = GNUNET_SYSERR;
- GNUNET_SCHEDULER_shutdown ();
- return 0;
- }
-
- GNUNET_assert(size >= MSIZE);
- GNUNET_assert(buf != NULL);
- cbuf = buf;
-
- hdr.header.size = htons (MSIZE);
- hdr.header.type = htons (MTYPE);
- hdr.num = htonl (counter++);
- GNUNET_memcpy (&cbuf[0], &hdr, sizeof(struct TestMessage));
- memset (&cbuf[sizeof(struct TestMessage)], '0', MSIZE - sizeof(struct TestMessage));
-
- {
- char *receiver_s = GNUNET_strdup (GNUNET_i2s (&ccc->p[0]->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Sending message %u of size %u from peer %u (`%4s') -> peer %u (`%s') !\n",
- (unsigned int) (counter - 1),
- MSIZE,
- ccc->p[1]->no,
- GNUNET_i2s (&ccc->p[1]->id),
- ccc->p[0]->no,
- receiver_s);
- GNUNET_free(receiver_s);
- }
-
- if (th == NULL)
- th = GNUNET_TRANSPORT_notify_transmit_ready (ccc->p[1]->th,
- &ccc->p[0]->id,
- MSIZE,
- TIMEOUT_TRANSMIT,
- ¬ify_ready,
- NULL);
-
+ static uint32_t cnt;
+
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_TRANSPORT_TESTING_send (ccc->p[1],
+ ccc->p[0],
+ GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
+ GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE,
+ ++cnt,
+ ¬ify_send,
+ NULL));