fixed bug where <1KB manifests would get found in 0-1K and 1K-2K

buckets.  Also removed some debugging. #9
This commit is contained in:
gardners 2012-10-03 18:22:48 +02:00
parent 8aa18db913
commit 90fd7e3fd8
2 changed files with 3 additions and 3 deletions

View File

@ -648,7 +648,7 @@ int rhizome_direct_bundle_iterator_unpickle_range(rhizome_direct_bundle_cursor *
/* Get start of range */
r->size_high=1LL<<pickled[0];
r->size_low=(r->size_high/2)+1;
if (r->size_low<=1024) r->size_low=0;
if (r->size_high<=1024) r->size_low=0;
for(v=0;v<4;v++) r->bid_low[v]=pickled[1+v];
for(;v<RHIZOME_MANIFEST_ID_BYTES;v++) r->bid_low[v]=0x00;
@ -715,8 +715,9 @@ int rhizome_direct_bundle_iterator_fill(rhizome_direct_bundle_cursor *c,int max_
if (!stuffed_now) {
/* no more matches in this size bin, so move up a size bin */
c->size_low=c->size_high+1;
if (c->size_low<=1025) c->size_low=0;
c->size_high*=2;
if (c->size_high<=1024) c->size_low=0;
DEBUGF("size=%lld..%lld",c->size_low,c->size_high);
/* Record that we covered to the end of that size bin */
memset(c->bid_high,0xff,RHIZOME_MANIFEST_ID_BYTES);
if (c->size_high>c->limit_size_high)

View File

@ -904,7 +904,6 @@ void rhizome_direct_http_dispatch(rhizome_direct_sync_request *r)
// unsigned char *bid_prefix=(unsigned char *)&p[i+1];
unsigned long long
bid_prefix_ll=rhizome_bar_bidprefix_ll((unsigned char *)&actionlist[i+1]);
dump("response",(unsigned char *)actionlist,content_length);
DEBUGF("%s %016llx* @ 0x%x",type==1?"push":"pull",bid_prefix_ll,i);
if (type==2&&r->pullP) {
/* Need to fetch manifest. Once we have the manifest, then we can