aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-01-30 16:38:34 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-01-30 16:38:34 +0000
commit46d4852e540132704b1d612f6ca53b8f77674900 (patch)
tree5662edf070b674e612ddbded0c844e04b2c37555 /src/transport/test_transport_api.c
parent8fd5ba93eabe126d751662bdedc507f3270cd5c0 (diff)
downloadgnunet-46d4852e540132704b1d612f6ca53b8f77674900.tar.gz
gnunet-46d4852e540132704b1d612f6ca53b8f77674900.zip
variable message size
Diffstat (limited to 'src/transport/test_transport_api.c')
-rw-r--r--src/transport/test_transport_api.c15
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 @@
52 */ 52 */
53#define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) 53#define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
54 54
55#define MSIZE 2600
56
55#define MTYPE 12345 57#define MTYPE 12345
56 58
57static char *test_source; 59static char *test_source;
@@ -193,22 +195,23 @@ notify_ready (void *cls, size_t size, void *buf)
193 return 0; 195 return 0;
194 } 196 }
195 197
196 GNUNET_assert (size >= 256); 198 GNUNET_assert (size >= MSIZE);
197 199
198 if (buf != NULL) 200 if (buf != NULL)
199 { 201 {
200 hdr = buf; 202 hdr = buf;
201 hdr->size = htons (sizeof (struct GNUNET_MessageHeader)); 203 hdr->size = htons (MSIZE);
202 hdr->type = htons (MTYPE); 204 hdr->type = htons (MTYPE);
203 } 205 }
204 char *ps = GNUNET_strdup (GNUNET_i2s (&p2->id));
205 206
206 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 207 char *ps = GNUNET_strdup (GNUNET_i2s (&p2->id));
208 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
207 "Peer %u (`%4s') sending message with type %u and size %u bytes to peer %u (`%4s')\n", 209 "Peer %u (`%4s') sending message with type %u and size %u bytes to peer %u (`%4s')\n",
208 p2->no, ps, ntohs (hdr->type), ntohs (hdr->size), p->no, 210 p2->no, ps, ntohs (hdr->type), ntohs (hdr->size), p->no,
209 GNUNET_i2s (&p->id)); 211 GNUNET_i2s (&p->id));
210 GNUNET_free (ps); 212 GNUNET_free (ps);
211 return sizeof (struct GNUNET_MessageHeader); 213
214 return MSIZE;
212} 215}
213 216
214 217
@@ -226,7 +229,7 @@ sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
226 p2->no, GNUNET_i2s (&p2->id), p1->no, receiver_s); 229 p2->no, GNUNET_i2s (&p2->id), p1->no, receiver_s);
227 GNUNET_free (receiver_s); 230 GNUNET_free (receiver_s);
228 231
229 th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, 256, 0, 232 th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, MSIZE, 0,
230 TIMEOUT_TRANSMIT, &notify_ready, 233 TIMEOUT_TRANSMIT, &notify_ready,
231 p1); 234 p1);
232} 235}