servlib/bundling/BundleDaemon.cc
changeset 43 721d4a13bd0b
parent 38 e51218da06a2
child 54 4122c50abb39
equal deleted inserted replaced
42:6e7559bfcb52 43:721d4a13bd0b
   920 
   920 
   921     }
   921     }
   922 
   922 
   923     // If the even source is PEER or STORE,
   923     // If the even source is PEER or STORE,
   924     // try to handle a BPQ block
   924     // try to handle a BPQ block
   925     if ( event->source_ == EVENTSRC_PEER  || 
   925     if ( event->source_ == EVENTSRC_APP   || 
       
   926          event->source_ == EVENTSRC_PEER  || 
   926          event->source_ == EVENTSRC_STORE ||
   927          event->source_ == EVENTSRC_STORE ||
   927          event->source_ == EVENTSRC_FRAGMENTATION) {
   928          event->source_ == EVENTSRC_FRAGMENTATION) {
   928 
   929 
   929         // TODO: change this to allow fragment responses be sent
   930         // TODO: change this to allow fragment responses be sent
   930         if ( ! bundle->is_fragment() ) {
   931         if ( ! bundle->is_fragment() ) {
  2668     if (bpq_block.kind() == BPQBlock::KIND_QUERY) {
  2669     if (bpq_block.kind() == BPQBlock::KIND_QUERY) {
  2669         if (answer_bpq_query(bundle, &bpq_block)) {
  2670         if (answer_bpq_query(bundle, &bpq_block)) {
  2670             event->daemon_only_ = true;
  2671             event->daemon_only_ = true;
  2671         }
  2672         }
  2672 
  2673 
  2673     } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE) {
  2674     } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE &&
       
  2675                event->source_ != EVENTSRC_APP) {   //Skip over local responces
  2674         accept_bpq_response(bundle, &bpq_block, event->source_ != EVENTSRC_STORE);
  2676         accept_bpq_response(bundle, &bpq_block, event->source_ != EVENTSRC_STORE);
  2675 
  2677 
  2676     } else {
  2678     } else {
  2677         log_err_p("/dtn/daemon/bpq", "ERROR - BPQ Block: invalid kind %d", bpq_block.kind());
  2679         log_err_p("/dtn/daemon/bpq", "ERROR - BPQ Block: invalid kind %d", 
       
  2680             bpq_block.kind());
  2678         return false; 
  2681         return false; 
  2679     }
  2682     }
  2680 
  2683 
  2681     return true;
  2684     return true;
  2682 }
  2685 }