Skip to content

Commit af87c20

Browse files
committed
nearly ready to do deliver received messages bseide local messages
1 parent 15b59d1 commit af87c20

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

src/net/sharksystem/asap/ASAPEngine.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public abstract class ASAPEngine implements ASAPStorage, ASAPProtocolEngine {
3535

3636
private ASAPOnlineMessageSender asapOnlineMessageSender;
3737
protected boolean contentChanged = false;
38+
private boolean sendReceivedChunks = false;
3839

3940
protected ASAPEngine(ASAPChunkStorage chunkStorage, CharSequence chunkContentFormat)
4041
throws ASAPException, IOException {
@@ -427,13 +428,24 @@ public void handleASAPInterest(ASAP_Interest_PDU_1_0 asapInterest, ASAP_1_0 prot
427428
//>>>>>>>>>>>>>>>>>>>debug
428429

429430
this.sendChunks(peer, this.getChunkStorage(), protocol, workingEra, lastEra, os);
430-
431431
//<<<<<<<<<<<<<<<<<<debug
432432
b = new StringBuilder();
433433
b.append(this.getLogStart());
434-
b.append("ended iterating chunks");
434+
b.append("ended iterating local chunks");
435435
System.out.println(b.toString());
436436
//>>>>>>>>>>>>>>>>>>>debug
437+
438+
if(this.isSendReceivedChunks()) {
439+
440+
}
441+
}
442+
443+
private boolean isSendReceivedChunks() {
444+
return this.sendReceivedChunks;
445+
}
446+
447+
public void setSendReceivedChunks(boolean on) {
448+
this.sendReceivedChunks = on;
437449
}
438450

439451
private void sendChunks(String peer, ASAPChunkStorage chunkStorage,

src/net/sharksystem/asap/ASAPProtocolEngine.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,10 @@ void handleASAPAssimilate(ASAP_AssimilationPDU_1_0 asap_assimilation, ASAP_1_0 p
3333
* @param drop
3434
*/
3535
void setDropDeliveredChunks(boolean drop);
36+
37+
/**
38+
* engine can deliver local message but also received messages - default false - send no received messages
39+
* @param on
40+
*/
41+
void setSendReceivedChunks(boolean on);
3642
}

test/net/sharksystem/asap/MultihopTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public void twoHops() throws IOException, ASAPException, InterruptedException {
3030
ui.doCreateASAPMultiEngine("Alice");
3131
ui.doOpen("7070 Alice");
3232
ui.doCreateASAPMultiEngine("Bob");
33+
3334
ui.doConnect("7070 Bob");
3435

3536
// wait a moment

0 commit comments

Comments
 (0)