# HG changeset patch # User aidan # Date 1313428499 -3600 # Node ID 721d4a13bd0be64f8785e14db6b4ebe97d80a661 # Parent 6e7559bfcb52499d25dd085e9b05cc6897cf9f37 updated daemon to answer local queries diff -r 6e7559bfcb52 -r 721d4a13bd0b servlib/bundling/BPQBlock.cc --- a/servlib/bundling/BPQBlock.cc Mon Aug 15 17:48:10 2011 +0100 +++ b/servlib/bundling/BPQBlock.cc Mon Aug 15 18:14:59 2011 +0100 @@ -190,12 +190,6 @@ ///////////////////////////////////////////////////// ASSERT ( block != NULL ); // ASSERT ( block->data() != NULL ); - // BPQ Kind must be 0 or 1 - if ( *(block->data()) != 0 && - *(block->data()) != 1 ) { - log_err_p(LOG, "BPQBlock::initialise: block->data() = %c(should be 0|1)", - *(block->data())); - } log_debug_p(LOG, "BPQBlock::initialise: block != NULL"); log_debug_p(LOG, "BPQBlock::initialise: block->data() != NULL"); @@ -228,6 +222,13 @@ log_debug_p(LOG, "BPQBlock::initialise: extracting buf"); buf = block->data(); + // BPQ Kind must be 0 or 1 + if ( *(block->data()) != 0 && + *(block->data()) != 1 ) { + log_err_p(LOG, "BPQBlock::initialise: block->data() = %c(should be 0|1)", + *(block->data())); + } + // BPQ-kind 1-byte if ( i < len ) { log_debug_p(LOG, "BPQBlock::initialise: extracting kind"); diff -r 6e7559bfcb52 -r 721d4a13bd0b servlib/bundling/BundleDaemon.cc --- a/servlib/bundling/BundleDaemon.cc Mon Aug 15 17:48:10 2011 +0100 +++ b/servlib/bundling/BundleDaemon.cc Mon Aug 15 18:14:59 2011 +0100 @@ -922,7 +922,8 @@ // If the even source is PEER or STORE, // try to handle a BPQ block - if ( event->source_ == EVENTSRC_PEER || + if ( event->source_ == EVENTSRC_APP || + event->source_ == EVENTSRC_PEER || event->source_ == EVENTSRC_STORE || event->source_ == EVENTSRC_FRAGMENTATION) { @@ -2670,11 +2671,13 @@ event->daemon_only_ = true; } - } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE) { + } else if (bpq_block.kind() == BPQBlock::KIND_RESPONSE && + event->source_ != EVENTSRC_APP) { //Skip over local responces accept_bpq_response(bundle, &bpq_block, event->source_ != EVENTSRC_STORE); } else { - log_err_p("/dtn/daemon/bpq", "ERROR - BPQ Block: invalid kind %d", bpq_block.kind()); + log_err_p("/dtn/daemon/bpq", "ERROR - BPQ Block: invalid kind %d", + bpq_block.kind()); return false; }