]> git.meshlink.io Git - utcp/commitdiff
Remove two unnecessary calls to abort().
authorGuus Sliepen <guus@meshlink.io>
Sun, 2 Jul 2017 12:58:56 +0000 (14:58 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sun, 2 Jul 2017 12:58:56 +0000 (14:58 +0200)
utcp.c

diff --git a/utcp.c b/utcp.c
index bb29de5824a923a89c3cb28dd110190c199d2d66..b0ba05428926ba1dd11c7b91c942d27d1fae97e7 100644 (file)
--- a/utcp.c
+++ b/utcp.c
@@ -151,7 +151,6 @@ static ssize_t buffer_put_at(struct buffer *buf, size_t offset, const void *data
        if(required > buf->maxsize) {
                if(offset >= buf->maxsize)
                        return 0;
-               abort();
                len = buf->maxsize - offset;
                required = buf->maxsize;
        }
@@ -647,8 +646,11 @@ cleanup:
  */
 static void sack_consume(struct utcp_connection *c, size_t len) {
        debug("sack_consume %lu\n", (unsigned long)len);
-       if(len > c->rcvbuf.used)
-               abort();
+       if(len > c->rcvbuf.used) {
+               debug("All SACK entries consumed");
+               c->sacks[0].len = 0;
+               return;
+       }
 
        buffer_get(&c->rcvbuf, NULL, len);