--- a/servlib/bundling/BPQCacheEntry.cc Tue Oct 18 11:52:07 2011 +0100
+++ b/servlib/bundling/BPQCacheEntry.cc Mon Oct 24 18:28:33 2011 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2006 Intel Corporation
+ * Copyright 2010-2011 Trinity College Dublin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,17 +24,21 @@
{
if ( ! bundle->is_fragment() ) {
log_debug("add complete response to cache entry");
+
fragments_.insert_sorted(bundle, BundleList::SORT_FRAG_OFFSET);
is_complete_ = true;
} else if ( bundle->is_fragment() && ! is_complete_ ) {
log_debug("add response fragment to cache entry");
+
fragments_.insert_sorted(bundle, BundleList::SORT_FRAG_OFFSET);
is_complete_ = check_complete();
} else if ( bundle->is_fragment() && is_complete_ ) {
log_debug("ignoring response fragment as cache entry is complete");
+ } else {
+ NOTREACHED;
}
return BP_SUCCESS;
@@ -42,7 +46,7 @@
//----------------------------------------------------------------------
int
-BPQCacheEntry::reassemble_fragments(){
+BPQCacheEntry::reassemble_fragments(Bundle* new_bundle, const Bundle* meta_bundle){
//TODO: implement this
NOTIMPLEMENTED;
return BP_FAIL;
@@ -62,7 +66,7 @@
size_t f_offset;
size_t f_origlen;
- size_t total_len = bundle_->payload().length();
+// size_t total_len = bundle_->payload().length();
int fragi = 0;
int fragn = fragments_.size();
@@ -80,9 +84,9 @@
ASSERT(fragment->is_fragment());
- if (f_origlen != total_len) {
+ if (f_origlen != total_len_) {
PANIC("check_completed: error fragment orig len %zu != total %zu",
- f_origlen, total_len);
+ f_origlen, total_len_);
// XXX/demmer deal with this
}
@@ -146,12 +150,12 @@
}
}
- if (done_up_to == total_len) {
+ if (done_up_to == total_len_) {
log_debug("check_completed reassembly complete!");
return true;
} else {
log_debug("check_completed reassembly not done (got %zu/%zu)",
- done_up_to, total_len);
+ done_up_to, total_len_);
return false;
}
}