921 return; |
921 return; |
922 } |
922 } |
923 |
923 |
924 } |
924 } |
925 |
925 |
926 // try to handle a BPQ block |
926 if ( bpq_cache_->cache_enabled_ ) { |
927 if ( event->source_ == EVENTSRC_APP || |
927 // try to handle a BPQ block |
928 event->source_ == EVENTSRC_PEER || |
928 if ( event->source_ == EVENTSRC_APP || |
929 event->source_ == EVENTSRC_STORE || |
929 event->source_ == EVENTSRC_PEER || |
930 event->source_ == EVENTSRC_FRAGMENTATION) { |
930 event->source_ == EVENTSRC_STORE || |
931 |
931 event->source_ == EVENTSRC_FRAGMENTATION) { |
932 handle_bpq_block(bundle, event); |
932 |
933 |
933 handle_bpq_block(bundle, event); |
|
934 } |
934 } |
935 } |
935 |
936 |
936 // If the bundle contains a BPQ query that was successfully answered |
937 // If the bundle contains a BPQ query that was successfully answered |
937 // a response has already been sent and the query deleted |
938 // a response has already been sent and the query deleted |
938 // so return from this function |
939 // so return from this function |
2688 event->daemon_only_ = true; |
2689 event->daemon_only_ = true; |
2689 } |
2690 } |
2690 |
2691 |
2691 } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE) { |
2692 } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE) { |
2692 // don't accept local responses |
2693 // don't accept local responses |
2693 if (!local_bundle && |
2694 if (!local_bundle) { |
2694 !bundle->is_fragment() ) {//TODO: remove this temp frag exclusion |
|
2695 |
2695 |
2696 if (bpq_cache()->add_response_bundle(bundle, &bpq_block) && |
2696 if (bpq_cache()->add_response_bundle(bundle, &bpq_block) && |
2697 event->source_ != EVENTSRC_STORE) { |
2697 event->source_ != EVENTSRC_STORE) { |
2698 |
2698 |
2699 bundle->set_in_datastore(true); |
2699 bundle->set_in_datastore(true); |
2700 actions_->store_add(bundle); |
2700 actions_->store_add(bundle); |
2701 } |
2701 } |
2702 } |
2702 } |
|
2703 |
2703 } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE_DO_NOT_CACHE_FRAG) { |
2704 } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE_DO_NOT_CACHE_FRAG) { |
2704 |
|
2705 // don't accept local responses |
2705 // don't accept local responses |
2706 if (!local_bundle && |
2706 if (!local_bundle && |
2707 !bundle->is_fragment() ) { |
2707 !bundle->is_fragment() ) { |
2708 |
2708 |
2709 if (bpq_cache()->add_response_bundle(bundle, &bpq_block) && |
2709 if (bpq_cache()->add_response_bundle(bundle, &bpq_block) && |