diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ot_fullscrape.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ot_fullscrape.c b/src/ot_fullscrape.c index 3e3b6cb..00c08e0 100644 --- a/src/ot_fullscrape.c +++ b/src/ot_fullscrape.c | |||
| @@ -381,7 +381,7 @@ static void fullscrape_make_zstd(int taskid, ot_tasktype mode) { | |||
| 381 | 381 | ||
| 382 | /* Check if there still is enough buffer left */ | 382 | /* Check if there still is enough buffer left */ |
| 383 | while (outbuf.pos + OT_SCRAPE_MAXENTRYLEN > outbuf.size) { | 383 | while (outbuf.pos + OT_SCRAPE_MAXENTRYLEN > outbuf.size) { |
| 384 | iovector.iov_len = outbuf.size; | 384 | iovector.iov_len = outbuf.pos; |
| 385 | 385 | ||
| 386 | if (workqueue_pushchunked(taskid, &iovector)) { | 386 | if (workqueue_pushchunked(taskid, &iovector)) { |
| 387 | free(iovector.iov_base); | 387 | free(iovector.iov_base); |
| @@ -419,6 +419,11 @@ static void fullscrape_make_zstd(int taskid, ot_tasktype mode) { | |||
| 419 | inbuf.src = (const void *)"ee"; | 419 | inbuf.src = (const void *)"ee"; |
| 420 | inbuf.size = strlen("ee"); | 420 | inbuf.size = strlen("ee"); |
| 421 | inbuf.pos = 0; | 421 | inbuf.pos = 0; |
| 422 | } else { | ||
| 423 | /* Nothing more to feed, and with no torrent written nothing was set */ | ||
| 424 | inbuf.src = (const void *)""; | ||
| 425 | inbuf.size = 0; | ||
| 426 | inbuf.pos = 0; | ||
| 422 | } | 427 | } |
| 423 | 428 | ||
| 424 | more_bytes = ZSTD_compressStream2(zstream, &outbuf, &inbuf, ZSTD_e_end); | 429 | more_bytes = ZSTD_compressStream2(zstream, &outbuf, &inbuf, ZSTD_e_end); |
