1
0
mirror of git://erdgeist.org/opentracker synced 2025-02-04 11:06:42 +00:00

Fix two issues when splitting an iovec to large iobatches

This commit is contained in:
Dirk Engling 2021-05-09 00:07:32 +02:00
parent 99544a1030
commit 3168071175

View File

@ -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; i<iovec_entries; ++i ) {
io_batch *current = cookie->batch + 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 );