Skip to content

Commit a4d5ec9

Browse files
committed
extracted sending chunk from another method
1 parent 6db3b8a commit a4d5ec9

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/net/sharksystem/asap/ASAPEngine.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,17 @@ 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);
430+
431+
//<<<<<<<<<<<<<<<<<<debug
432+
b = new StringBuilder();
433+
b.append(this.getLogStart());
434+
b.append("ended iterating chunks");
435+
System.out.println(b.toString());
436+
//>>>>>>>>>>>>>>>>>>>debug
437+
}
438+
439+
private void sendChunks(String peer, ASAP_1_0 protocol, int workingEra, int lastEra, OutputStream os) throws IOException, ASAPException {
429440
/*
430441
There is a little challenge: era uses a circle of numbers
431442
We cannot say: higher number, later era. That rule does *not*
@@ -443,7 +454,7 @@ public void handleASAPInterest(ASAP_Interest_PDU_1_0 asapInterest, ASAP_1_0 prot
443454

444455
List<ASAPChunk> chunks = this.chunkStorage.getChunks(workingEra);
445456
//<<<<<<<<<<<<<<<<<<debug
446-
b = new StringBuilder();
457+
StringBuilder b = new StringBuilder();
447458
b.append(this.getLogStart());
448459
b.append("start iterating chunks with working Era: ");
449460
b.append(workingEra);
@@ -533,13 +544,6 @@ void assimilate(CharSequence peer, CharSequence recipientPeer, CharSequence form
533544

534545
// as long as not already performed last round
535546
} while(!lastRound);
536-
537-
//<<<<<<<<<<<<<<<<<<debug
538-
b = new StringBuilder();
539-
b.append(this.getLogStart());
540-
b.append("ended iterating chunks");
541-
System.out.println(b.toString());
542-
//>>>>>>>>>>>>>>>>>>>debug
543547
}
544548

545549
private boolean isDropDeliveredChunks() {

0 commit comments

Comments
 (0)