summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2021-05-09 00:07:32 +0200
committerDirk Engling <erdgeist@erdgeist.org>2021-05-09 00:07:32 +0200
commit3168071175e9b5792a08adeb4784073f2e5df58b (patch)
treea4352216f3b49fc9972751499fdfa30f279d9c91
parent99544a10306382c285e1f3166b7dcb8686ef4a2d (diff)
Fix two issues when splitting an iovec to large iobatches
-rw-r--r--ot_http.c4
1 files 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
168 168
169 /* Split huge iovectors into separate io_batches */ 169 /* Split huge iovectors into separate io_batches */
170 for( i=0; i<iovec_entries; ++i ) { 170 for( i=0; i<iovec_entries; ++i ) {
171 io_batch *current = cookie->batch + cookie->batches; 171 io_batch *current = cookie->batch + cookie->batches - 1;
172 172
173 /* If the current batch's limit is reached, try to reallocate a new batch to work on */ 173 /* If the current batch's limit is reached, try to reallocate a new batch to work on */
174 if( current->bytesleft > OT_BATCH_LIMIT ) { 174 if( current->bytesleft > OT_BATCH_LIMIT ) {
@@ -180,7 +180,7 @@ ssize_t http_sendiovecdata( const int64 sock, struct ot_workstruct *ws, int iove
180 } 180 }
181 } 181 }
182 182
183 iob_addbuf_munmap( current, iovector[i].iov_base, iovector[i].iov_len ); 183 iob_addbuf_free( current, iovector[i].iov_base, iovector[i].iov_len );
184 } 184 }
185 free( iovector ); 185 free( iovector );
186 186