From 9c41de54bb7c80349c45d34bd53e734ee3e88b5b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 28 Jan 2016 17:02:31 +0100 Subject: Make hashing classes more robust, report complete blocks without hash info as hashing --- src/main/java/org/openslx/filetransfer/util/HashChecker.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/openslx/filetransfer/util/HashChecker.java') diff --git a/src/main/java/org/openslx/filetransfer/util/HashChecker.java b/src/main/java/org/openslx/filetransfer/util/HashChecker.java index 8bf97a4..5b647aa 100644 --- a/src/main/java/org/openslx/filetransfer/util/HashChecker.java +++ b/src/main/java/org/openslx/filetransfer/util/HashChecker.java @@ -43,6 +43,7 @@ public class HashChecker return; invalid = true; } + LOGGER.debug( "Marking all queued chunks as failed" ); for ( ;; ) { HashTask task = queue.poll(); if ( task == null ) @@ -132,7 +133,6 @@ public class HashChecker continue; } catch ( InterruptedException e ) { LOGGER.info( "Interrupted while waiting for hash task", e ); - threadFailed( this ); break; } // Calculate digest @@ -141,10 +141,15 @@ public class HashChecker HashResult result = Arrays.equals( digest, task.chunk.getSha1Sum() ) ? HashResult.VALID : HashResult.INVALID; execCallback( task, result ); if ( extraThread && queue.isEmpty() ) { - LOGGER.info( "Stopping additional hash checker" ); break; } } + if ( extraThread ) { + LOGGER.info( "Stopped additional hash checker" ); + } else { + LOGGER.info( "Stopped MAIN hash checker" ); + } + threadFailed( this ); } } -- cgit v1.2.3-55-g7522