Skip to content

Commit 15b59d1

Browse files
committed
sending chunk algorithm extracted
1 parent a4d5ec9 commit 15b59d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/net/sharksystem/asap/ASAPEngine.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public void handleASAPInterest(ASAP_Interest_PDU_1_0 asapInterest, ASAP_1_0 prot
426426
System.out.println(b.toString());
427427
//>>>>>>>>>>>>>>>>>>>debug
428428

429-
this.sendChunks(peer, protocol, workingEra, lastEra, os);
429+
this.sendChunks(peer, this.getChunkStorage(), protocol, workingEra, lastEra, os);
430430

431431
//<<<<<<<<<<<<<<<<<<debug
432432
b = new StringBuilder();
@@ -436,7 +436,9 @@ public void handleASAPInterest(ASAP_Interest_PDU_1_0 asapInterest, ASAP_1_0 prot
436436
//>>>>>>>>>>>>>>>>>>>debug
437437
}
438438

439-
private void sendChunks(String peer, ASAP_1_0 protocol, int workingEra, int lastEra, OutputStream os) throws IOException, ASAPException {
439+
private void sendChunks(String peer, ASAPChunkStorage chunkStorage,
440+
ASAP_1_0 protocol, int workingEra,
441+
int lastEra, OutputStream os) throws IOException, ASAPException {
440442
/*
441443
There is a little challenge: era uses a circle of numbers
442444
We cannot say: higher number, later era. That rule does *not*
@@ -452,7 +454,7 @@ private void sendChunks(String peer, ASAP_1_0 protocol, int workingEra, int last
452454
do {
453455
lastRound = workingEra == lastEra;
454456

455-
List<ASAPChunk> chunks = this.chunkStorage.getChunks(workingEra);
457+
List<ASAPChunk> chunks = chunkStorage.getChunks(workingEra);
456458
//<<<<<<<<<<<<<<<<<<debug
457459
StringBuilder b = new StringBuilder();
458460
b.append(this.getLogStart());

0 commit comments

Comments
 (0)