servlib/bundling/BPQBlockProcessor.cc
changeset 55 1938118cd06c
parent 54 4122c50abb39
child 64 1296a0283271
equal deleted inserted replaced
54:4122c50abb39 55:1938118cd06c
    83                            const LinkRef&   link,
    83                            const LinkRef&   link,
    84                            list_owner_t     list)
    84                            list_owner_t     list)
    85 {
    85 {
    86     log_info_p(LOG, "BPQBlockProcessor::prepare()");
    86     log_info_p(LOG, "BPQBlockProcessor::prepare()");
    87 
    87 
       
    88     (void)bundle;
    88     (void)link;
    89     (void)link;
    89     (void)list; 
    90     (void)list; 
    90 
    91 
    91     log_debug_p(LOG, "prepare(): data_length() = %lu", source->data_length());
    92     log_debug_p(LOG, "prepare(): data_length() = %u", source->data_length());
    92     log_debug_p(LOG, "prepare(): data_offset() = %lu", source->data_offset());
    93     log_debug_p(LOG, "prepare(): data_offset() = %u", source->data_offset());
    93     log_debug_p(LOG, "prepare(): full_length() = %lu", source->full_length());
    94     log_debug_p(LOG, "prepare(): full_length() = %u", source->full_length());
    94 
    95 
    95     // Received blocks are added to the end of the list (which
    96     // Received blocks are added to the end of the list (which
    96     // maintains the order they arrived in) but API blocks 
    97     // maintains the order they arrived in) but API blocks 
    97     // are added after the primary block (that is, before the
    98     // are added after the primary block (that is, before the
    98     // payload and the received blocks). This places them "outside"
    99     // payload and the received blocks). This places them "outside"
   215         return false;
   216         return false;
   216     }
   217     }
   217     
   218     
   218     if ( block->data_offset() + block->data_length() != block->full_length() ) {
   219     if ( block->data_offset() + block->data_length() != block->full_length() ) {
   219         
   220         
   220         log_err_p(LOG, "offset (%lu) + data len (%lu) is not equal to the full len (%lu)",
   221         log_err_p(LOG, "offset (%u) + data len (%u) is not equal to the full len (%u)",
   221                   block->data_offset(), block->data_length(), block->full_length() );
   222                   block->data_offset(), block->data_length(), block->full_length() );
   222         *deletion_reason = BundleProtocol::REASON_BLOCK_UNINTELLIGIBLE;
   223         *deletion_reason = BundleProtocol::REASON_BLOCK_UNINTELLIGIBLE;
   223         return false;
   224         return false;
   224     }
   225     }
   225 
   226 
   226     if ( block->contents().buf_len() < block->full_length() ) {
   227     if ( block->contents().buf_len() < block->full_length() ) {
   227 
   228 
   228         log_err_p(LOG, "block buffer len (%lu) is less than the full len (%lu)",
   229         log_err_p(LOG, "block buffer len (%u) is less than the full len (%u)",
   229                   block->contents().buf_len(), block->full_length() );
   230                   block->contents().buf_len(), block->full_length() );
   230         *deletion_reason = BundleProtocol::REASON_BLOCK_UNINTELLIGIBLE;
   231         *deletion_reason = BundleProtocol::REASON_BLOCK_UNINTELLIGIBLE;
   231         return false;
   232         return false;
   232     }
   233     }
   233 
   234