diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-30 16:38:34 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-30 16:38:34 +0000 |
commit | 46d4852e540132704b1d612f6ca53b8f77674900 (patch) | |
tree | 5662edf070b674e612ddbded0c844e04b2c37555 | |
parent | 8fd5ba93eabe126d751662bdedc507f3270cd5c0 (diff) |
variable message size
-rw-r--r-- | src/transport/test_transport_api.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 9ef5fc968..401657c9f 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c @@ -52,6 +52,8 @@ */ #define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) +#define MSIZE 2600 + #define MTYPE 12345 static char *test_source; @@ -193,22 +195,23 @@ notify_ready (void *cls, size_t size, void *buf) return 0; } - GNUNET_assert (size >= 256); + GNUNET_assert (size >= MSIZE); if (buf != NULL) { hdr = buf; - hdr->size = htons (sizeof (struct GNUNET_MessageHeader)); + hdr->size = htons (MSIZE); hdr->type = htons (MTYPE); } - char *ps = GNUNET_strdup (GNUNET_i2s (&p2->id)); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + char *ps = GNUNET_strdup (GNUNET_i2s (&p2->id)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer %u (`%4s') sending message with type %u and size %u bytes to peer %u (`%4s')\n", p2->no, ps, ntohs (hdr->type), ntohs (hdr->size), p->no, GNUNET_i2s (&p->id)); GNUNET_free (ps); - return sizeof (struct GNUNET_MessageHeader); + + return MSIZE; } @@ -226,7 +229,7 @@ sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) p2->no, GNUNET_i2s (&p2->id), p1->no, receiver_s); GNUNET_free (receiver_s); - th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, 256, 0, + th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, MSIZE, 0, TIMEOUT_TRANSMIT, ¬ify_ready, p1); } |