progress += r;
}
outputStream.flush();
- eventBus.post(new DccDownloadFinished(this));
+ if ((size == -1) || (progress == size)) {
+ eventBus.post(new DccDownloadFinished(this));
+ } else {
+ eventBus.post(new DccDownloadFailed(this, new IOException("Download aborted.")));
+ }
} catch (IOException ioe1) {
logger.log(Level.WARNING, "I/O error while receiving DCC!", ioe1);
eventBus.post(new DccDownloadFailed(this, ioe1));