| 1 |  |  | /** | 
    
    | 2 |  |  |  * This file is part of the CernVM File System. | 
    
    | 3 |  |  |  */ | 
    
    | 4 |  |  |  | 
    
    | 5 |  |  | #include "cvmfs_config.h" | 
    
    | 6 |  |  | #include "task_hash.h" | 
    
    | 7 |  |  |  | 
    
    | 8 |  |  | #include <cstdlib> | 
    
    | 9 |  |  |  | 
    
    | 10 |  |  | #include "hash.h" | 
    
    | 11 |  |  |  | 
    
    | 12 |  |  |  | 
    
    | 13 |  | 546017 | void TaskHash::Process(BlockItem *input_block) { | 
    
    | 14 |  | 546017 |   ChunkItem *chunk = input_block->chunk_item(); | 
    
    | 15 | ✗✓ | 546017 |   assert(chunk != NULL); | 
    
    | 16 |  |  |  | 
    
    | 17 | ✓✓✗ | 546017 |   switch (input_block->type()) { | 
    
    | 18 |  |  |     case BlockItem::kBlockData: | 
    
    | 19 |  |  |       shash::Update(input_block->data(), input_block->size(), | 
    
    | 20 |  | 544233 |                     chunk->hash_ctx()); | 
    
    | 21 |  | 544229 |       break; | 
    
    | 22 |  |  |     case BlockItem::kBlockStop: | 
    
    | 23 |  | 1784 |       shash::Final(chunk->hash_ctx(), chunk->hash_ptr()); | 
    
    | 24 |  | 1784 |       break; | 
    
    | 25 |  |  |     default: | 
    
    | 26 |  |  |       abort(); | 
    
    | 27 |  |  |   } | 
    
    | 28 |  |  |  | 
    
    | 29 |  | 546013 |   tubes_out_->Dispatch(input_block); | 
    
    | 30 |  | 546021 | } |