-#define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-
-
-static size_t
-notify_ready (void *cls,
- size_t size,
- void *buf)
-{
- struct TRANSPORT_TESTING_SendJob *sj = cls;
- struct GNUNET_TRANSPORT_TESTING_PeerContext *sender = sj->sender;
- struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver = sj->receiver;
- struct GNUNET_TRANSPORT_TESTING_Handle *tth = sender->tth;
- uint16_t msize = sj->msize;
- struct GNUNET_TRANSPORT_TESTING_TestMessage *test;
-
- sj->th = NULL;
- GNUNET_CONTAINER_DLL_remove (tth->sj_head,
- tth->sj_tail,
- sj);
- if (NULL == buf)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Timeout occurred while waiting for transmit_ready\n");
- GNUNET_SCHEDULER_shutdown ();
- GNUNET_free (sj);
- return 0;
- }
-
- GNUNET_assert (size >= msize);
- if (NULL != buf)
- {
- memset (buf, sj->num, msize);
- test = buf;
- test->header.size = htons (msize);
- test->header.type = htons (sj->mtype);
- test->num = htonl (sj->num);
- }
-
- {
- char *ps = GNUNET_strdup (GNUNET_i2s (&sender->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Sending message %u from %u (%s) with type %u and size %u bytes to peer %u (%s)\n",
- (unsigned int) sj->num,
- sender->no,
- ps,
- sj->mtype,
- msize,
- receiver->no,
- GNUNET_i2s (&receiver->id));
- GNUNET_free (ps);
- }
- if (NULL != sj->cont)
- GNUNET_SCHEDULER_add_now (sj->cont,
- sj->cont_cls);
- GNUNET_free (sj);
- return msize;
-}