@@ -412,12 +412,17 @@ public void handleASAPAssimilate(ASAP_AssimilationPDU_1_0 asapAssimilationPDU, A
412412 MessagesContainer messagesContainer = null ;
413413 ASAPInMemoTransientMessages transientMessages = null ;
414414
415+ ASAPHop lastHop = new ASAPHopImpl (encounteredPeer , asapAssimilationPDU .verified (),
416+ asapAssimilationPDU .encrypted (), connectionType );
417+
415418 try {
416419 if (eraSender != ASAP .TRANSIENT_ERA ) {
417420 incomingChunk = this .getIncomingChunk (encounteredPeer , asapAssimilationPDU );
418421 messagesContainer = incomingChunk ;
419422 } else {
420- transientMessages = new ASAPInMemoTransientMessages (asapAssimilationPDU );
423+ transientMessages =
424+ new ASAPInMemoTransientMessages (asapAssimilationPDU , lastHop );
425+
421426 messagesContainer = transientMessages ;
422427 }
423428 }
@@ -439,8 +444,6 @@ public void handleASAPAssimilate(ASAP_AssimilationPDU_1_0 asapAssimilationPDU, A
439444 Log .writeLog (this , this .toString (), "got hop list: " + asapHopList );
440445
441446 // add this new hop
442- ASAPHop lastHop = new ASAPHopImpl (encounteredPeer , asapAssimilationPDU .verified (),
443- asapAssimilationPDU .encrypted (), connectionType );
444447 asapHopList .add (lastHop );
445448
446449 // add hop list to newly create message container
@@ -451,16 +454,17 @@ public void handleASAPAssimilate(ASAP_AssimilationPDU_1_0 asapAssimilationPDU, A
451454 // read all messages
452455 //<<<<<<<<<<<<<<<<<<debug
453456 b = new StringBuilder ();
454- b .append ("call " );
455- b .append (listener .getClass ().getSimpleName ());
456- b .append (".chunkAssimilated(senderE2E: " );
457+ b .append ("assimilated: senderE2E: " );
457458 b .append (senderE2E );
458459 b .append (", uri: " );
459460 b .append (uri );
460461 b .append (", eraSender: " );
461462 if (eraSender != ASAP .TRANSIENT_ERA ) b .append (eraSender );
462463 else b .append ("transient" );
463- b .append (")" );
464+ if (listener != null ) {
465+ b .append (" | listener: " );
466+ b .append (listener .getClass ().getSimpleName ());
467+ }
464468 Log .writeLog (this , this .toString (), b .toString ());
465469 //>>>>>>>>>>>>>>>>>>>debug
466470
@@ -474,11 +478,11 @@ public void handleASAPAssimilate(ASAP_AssimilationPDU_1_0 asapAssimilationPDU, A
474478 asapHopList
475479 );
476480 } else {
477- listener .transientChunkReceived (transientMessages , encounteredPeer , asapHopList );
481+ listener .transientMessagesReceived (transientMessages , lastHop );
478482 }
479483
480484 } else {
481- Log .writeLog (this , this .toString (), "no chunk received listener found" );
485+ Log .writeLog (this , this .toString (), "no chunk assimilated listener found" );
482486 }
483487 }
484488
@@ -490,7 +494,8 @@ private ASAPInternalChunk getIncomingChunk(String encounteredPeer, ASAP_Assimila
490494 String senderE2E = asapAssimilationPDU .getSender ();
491495 ASAPInternalStorage incomingStorage = (ASAPInternalStorage ) this .getIncomingStorage (senderE2E , true );
492496 ASAPChunkStorage incomingChunkStorage = incomingStorage .getChunkStorage ();
493- Log .writeLog (this , this .toString (), "got incoming chunk storage for senderE2E: " + senderE2E );
497+ Log .writeLog (this , this .toString (), "got incoming chunk storage "
498+ + incomingChunkStorage );
494499
495500 // get local target for data to come
496501 if (!incomingChunkStorage .existsChunk (uri , eraSender )) {
@@ -525,7 +530,7 @@ private ASAPInternalChunk getIncomingChunk(String encounteredPeer, ASAP_Assimila
525530 && PeerIDHelper .sameID (encounteredPeer , senderE2E ) // E2E sender == P2P sender
526531 ) {
527532 Log .writeLog (this , this .toString (),
528- "received chunk exists but sender is originator and current era: "
533+ "received chunk exists but sender is originator and current era - message will be added : "
529534 + senderE2E + " | " + eraSender + " | " + uri );
530535
531536 // finish routing...
@@ -556,6 +561,7 @@ private void streamReceivedMessages2Container(MessagesContainer messagesContaine
556561 b .append (")" );
557562 Log .writeLog (this , this .toString (), b .toString ());
558563 //>>>>>>>>>>>>>>>>>>>debug
564+
559565 messagesContainer .addMessage (is , nextOffset - offset );
560566 //if(!changed) { changed = true; this.contentChanged();}
561567 offset = nextOffset ;
@@ -576,7 +582,7 @@ private void streamReceivedMessages2Container(MessagesContainer messagesContaine
576582
577583 private boolean hasSufficientCrypto (ASAP_PDU_1_0 pdu ) {
578584 if (this .getCryptoControl () == null ) {
579- Log .writeLog (this , this .toString (), "crypto control set allow anything" );
585+ Log .writeLog (this , this .toString (), "crypto control set to allow anything" );
580586 return true ;
581587 }
582588
0 commit comments