Interrupt streaming thread, if end of stream is reached

Before the thread would just linger around and prevent the download
from closing the file
This commit is contained in:
0xboobface 2018-11-14 16:21:16 +01:00
parent 71d293b778
commit d26bb2660b
1 changed files with 7 additions and 2 deletions

View File

@ -123,8 +123,12 @@ public class Streamer {
} }
} }
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
log.error("Interrupted while waiting for packet"); if(!endOfSourceReached) {
continue; log.error("Interrupted while waiting for packet");
continue;
} else {
break;
}
} }
int pid = packet.getPid(); int pid = packet.getPid();
@ -283,6 +287,7 @@ public class Streamer {
log.error("Error reading from source", e); log.error("Error reading from source", e);
} finally { } finally {
endOfSourceReached = true; endOfSourceReached = true;
streamingThread.interrupt();
} }
} }