From 3168071175e9b5792a08adeb4784073f2e5df58b Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 9 May 2021 00:07:32 +0200 Subject: Fix two issues when splitting an iovec to large iobatches --- ot_http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ot_http.c b/ot_http.c index 6869687..2e16b58 100644 --- a/ot_http.c +++ b/ot_http.c @@ -168,7 +168,7 @@ ssize_t http_sendiovecdata( const int64 sock, struct ot_workstruct *ws, int iove /* Split huge iovectors into separate io_batches */ for( i=0; ibatch + cookie->batches; + io_batch *current = cookie->batch + cookie->batches - 1; /* If the current batch's limit is reached, try to reallocate a new batch to work on */ if( current->bytesleft > OT_BATCH_LIMIT ) { @@ -180,7 +180,7 @@ ssize_t http_sendiovecdata( const int64 sock, struct ot_workstruct *ws, int iove } } - iob_addbuf_munmap( current, iovector[i].iov_base, iovector[i].iov_len ); + iob_addbuf_free( current, iovector[i].iov_base, iovector[i].iov_len ); } free( iovector ); -- cgit v1.2.3