Make compression interruptible
This commit is contained in:
parent
456179018a
commit
58c84cda3b
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
#include "compression.hh"
|
#include "compression.hh"
|
||||||
#include "types.hh"
|
#include "util.hh"
|
||||||
|
|
||||||
#include <lzma.h>
|
#include <lzma.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -35,6 +35,7 @@ std::string compressXZ(const std::string & in)
|
||||||
strm().avail_out = sizeof(outbuf);
|
strm().avail_out = sizeof(outbuf);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
checkInterrupt();
|
||||||
|
|
||||||
if (strm().avail_in == 0)
|
if (strm().avail_in == 0)
|
||||||
action = LZMA_FINISH;
|
action = LZMA_FINISH;
|
||||||
|
@ -73,6 +74,7 @@ ref<std::string> decompressXZ(const std::string & in)
|
||||||
strm().avail_out = sizeof(outbuf);
|
strm().avail_out = sizeof(outbuf);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
checkInterrupt();
|
||||||
|
|
||||||
if (strm().avail_in == 0)
|
if (strm().avail_in == 0)
|
||||||
action = LZMA_FINISH;
|
action = LZMA_FINISH;
|
||||||
|
|
Loading…
Reference in a new issue