432 state->bundle()->mutable_payload()-> |
432 state->bundle()->mutable_payload()-> |
433 write_data(fragment->payload(), 0, fraglen, |
433 write_data(fragment->payload(), 0, fraglen, |
434 fragment->frag_offset()); |
434 fragment->frag_offset()); |
435 |
435 |
436 |
436 |
437 // XXX/lynch ensure that non-payload blocks are added to fragment bundle |
437 // XXX/lynch ensure that extension blocks are added to the assembled bundle |
438 // but only add one block of each type |
438 // Only add each block type once |
|
439 // And don't add primary / payload blocks (this is done elsewhere) |
439 BlockInfoVec::const_iterator block_i; |
440 BlockInfoVec::const_iterator block_i; |
440 for (block_i = fragment->recv_blocks().begin(); |
441 for (block_i = fragment->recv_blocks().begin(); |
441 block_i != fragment->recv_blocks().end(); |
442 block_i != fragment->recv_blocks().end(); |
442 ++block_i) |
443 ++block_i) |
443 { |
444 { |
444 if ( !state->bundle()->recv_blocks().has_block( block_i->type() ) && |
445 if ( !state->bundle()->recv_blocks().has_block( block_i->type() ) && |
|
446 block_i->type() != BundleProtocol::PRIMARY_BLOCK && |
445 block_i->type() != BundleProtocol::PAYLOAD_BLOCK ) { |
447 block_i->type() != BundleProtocol::PAYLOAD_BLOCK ) { |
446 |
448 |
447 log_debug("Adding block(%d) to fragment bundle", block_i->type()); |
449 log_debug("Adding block(%d) to fragment bundle", block_i->type()); |
448 |
450 |
449 state->bundle()->mutable_recv_blocks()-> |
451 state->bundle()->mutable_recv_blocks()-> |