Skip to content

Commit 881d3bf

Browse files
committed
asap hop list is transmitted with assimilate pdu
1 parent 6c99df4 commit 881d3bf

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

src/net/sharksystem/asap/engine/ASAPEngine.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,18 @@ public void handleASAPAssimilate(ASAP_AssimilationPDU_1_0 asapAssimilationPDU, A
514514
// receiving has no effect on era.
515515
//if(!changed) { changed = true; this.contentChanged();}
516516

517+
// add hop list.
518+
List<ASAPHop> asapHopList = asapAssimilationPDU.getASAPHopList();
519+
Log.writeLog(this, "got hop list: " + asapHopList);
520+
521+
// add this new hop
522+
ASAPHop lastHop = new ASAPHopImpl(encounteredPeer, asapAssimilationPDU.verified(),
523+
asapAssimilationPDU.encrypted(), connectionType);
524+
525+
asapHopList.add(lastHop);
526+
527+
incomingChunk.setASAPHopList(asapHopList);
528+
517529
// read all messages
518530
if(listener != null) {
519531
//<<<<<<<<<<<<<<<<<<debug

src/net/sharksystem/asap/engine/ASAPInternalChunk.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,6 @@ public interface ASAPInternalChunk extends ASAPChunk {
8686
void copyMetaData(ASAPChannel channel) throws IOException;
8787

8888
List<ASAPHop> getASAPHopList();
89+
90+
void setASAPHopList(List<ASAPHop> asapHopList);
8991
}

src/net/sharksystem/asap/engine/ASAPInternalChunkFS.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public List<ASAPHop> getASAPHopList() {
5656
return this.hopList;
5757
}
5858

59+
public void setASAPHopList(List<ASAPHop> asapHopList) {
60+
this.hopList = asapHopList;
61+
}
62+
5963
public HashMap<String, String> getExtraData() {
6064
return this.extraData;
6165
}

src/net/sharksystem/asap/protocol/ASAP_AssimilationPDU_1_0.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package net.sharksystem.asap.protocol;
22

3+
import net.sharksystem.asap.ASAPHop;
4+
35
import java.io.IOException;
46
import java.io.InputStream;
57
import java.io.OutputStream;
@@ -31,6 +33,8 @@ public interface ASAP_AssimilationPDU_1_0 extends ASAP_PDU_1_0 {
3133
*/
3234
List<Integer> getMessageOffsets();
3335

36+
List<ASAPHop> getASAPHopList();
37+
3438
/**
3539
* Streams data into a storage. That method should be used instead of getData() when possible.
3640
* Data can directly be passed from network to its final destination without allocation memory

src/net/sharksystem/asap/protocol/AssimilationPDU_Impl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public List<Integer> getMessageOffsets() {
140140
return this.offsets;
141141
}
142142

143+
public List<ASAPHop> getASAPHopList() {
144+
return this.asapHopList;
145+
}
146+
143147
@Override
144148
public byte[] getData() throws IOException {
145149
if(this.data == null) {

0 commit comments

Comments
 (0)