]> git.meshlink.io Git - utcp/blobdiff - test.c
Handle channel closure during a receive callback when the ringbuffer wraps.
[utcp] / test.c
diff --git a/test.c b/test.c
index e04e17bec2e6e7cfb5154bc59aaa9e4fcb4142f6..2a273de70463dbe4f39117cc50ed438dc46c4834 100644 (file)
--- a/test.c
+++ b/test.c
@@ -159,7 +159,7 @@ static void set_mtu(struct utcp *u, int s) {
 
        debug("Using MTU %lu\n", mtu);
 
-       utcp_set_mtu(u, mtu ? mtu - 48 : 1300);
+       utcp_set_mtu(u, mtu ? mtu - 28 : 1300);
 }
 
 int main(int argc, char *argv[]) {
@@ -291,7 +291,7 @@ int main(int argc, char *argv[]) {
 
        char buf[102400];
 
-       struct timeval timeout = utcp_timeout(u);
+       struct timespec timeout = utcp_timeout(u);
 
        while(!connected || utcp_is_active(u)) {
                size_t max = c ? utcp_get_sndbuf_free(c) : 0;
@@ -304,7 +304,7 @@ int main(int argc, char *argv[]) {
                        max = read_size;
                }
 
-               int timeout_ms = timeout.tv_sec * 1000 + timeout.tv_usec / 1000 + 1;
+               int timeout_ms = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000 + 1;
 
                debug("polling, dir = %d, timeout = %d\n", dir, timeout_ms);