X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=test.c;h=87a041153c8aef7aadec93896142be2d75469978;hb=889cb601fab517d2045f7acb7c14cf004059232d;hp=68b42b25e9ab19f122b4ae9425adc32b086d5342;hpb=2cf23102d2fff0a40a940990ecf752625b64d6b2;p=utcp diff --git a/test.c b/test.c index 68b42b2..87a0411 100644 --- a/test.c +++ b/test.c @@ -32,6 +32,7 @@ long total_out; long total_in; FILE *reference; long mtu = 0; +long bufsize; char *reorder_data; size_t reorder_len; @@ -94,6 +95,12 @@ void do_accept(struct utcp_connection *nc, uint16_t port) { (void)port; utcp_accept(nc, do_recv, NULL); c = nc; + + if(bufsize) { + utcp_set_sndbuf(c, bufsize); + utcp_set_rcvbuf(c, bufsize); + } + utcp_set_accept_cb(c->utcp, NULL, NULL); } @@ -205,6 +212,10 @@ int main(int argc, char *argv[]) { mtu = atoi(getenv("MTU")); } + if(getenv("BUFSIZE")) { + bufsize = atoi(getenv("BUFSIZE")); + } + char *reference_filename = getenv("REFERENCE"); if(reference_filename) { @@ -267,6 +278,11 @@ int main(int argc, char *argv[]) { if(!server) { set_mtu(u, s); c = utcp_connect_ex(u, 1, do_recv, NULL, flags); + + if(bufsize) { + utcp_set_sndbuf(c, bufsize); + utcp_set_rcvbuf(c, bufsize); + } } struct pollfd fds[2] = {