# HG changeset patch # User aidan # Date 1313408159 -3600 # Node ID 25401075f22bb5c480359148757430c55a863325 # Parent 2bc8cc69d2a5827b41e1efd86dca191129538279 updated frag manager diff -r 2bc8cc69d2a5 -r 25401075f22b servlib/bundling/FragmentManager.cc --- a/servlib/bundling/FragmentManager.cc Fri Aug 12 13:55:56 2011 +0100 +++ b/servlib/bundling/FragmentManager.cc Mon Aug 15 12:35:59 2011 +0100 @@ -432,9 +432,27 @@ state->bundle()->mutable_payload()-> write_data(fragment->payload(), 0, fraglen, fragment->frag_offset()); - + + + // XXX/lynch ensure that non-payload blocks are added to fragment bundle + // but only add one block of each type + BlockInfoVec::const_iterator block_i; + for (block_i = fragment->recv_blocks().begin(); + block_i != fragment->recv_blocks().end(); + ++block_i) + { + if ( !state->bundle()->recv_blocks().has_block( block_i->type() ) && + block_i->type() != BundleProtocol::PAYLOAD_BLOCK ) { + + log_debug("Adding block(%d) to fragment bundle", block_i->type()); + + state->bundle()->mutable_recv_blocks()-> + push_back(BlockInfo(*block_i)); + } + } // XXX/jmmikkel this ensures that we have a set of blocks in the // reassembled bundle, but eventually reassembly will have to do much more + /* if (fragment->frag_offset() == 0 && !state->bundle()->recv_blocks().empty()) { @@ -442,11 +460,15 @@ for (block_i = fragment->recv_blocks().begin(); block_i != fragment->recv_blocks().end(); ++block_i) { + + log_debug("Adding block(%d) to fragment bundle", (*block_i).type()); + state->bundle()->mutable_recv_blocks()-> push_back(BlockInfo(*block_i)); } } - + */ + // check see if we're done if (! state->check_completed()) { return;