This commit is contained in:
Haris Khan
2024-10-22 17:37:17 -04:00
parent c31d20fec0
commit a9dc482bda
25 changed files with 66 additions and 44 deletions

View File

@@ -3,6 +3,7 @@ package tunnel
import (
"encoding/binary"
"errors"
common "github.com/go-i2p/go-i2p/lib/common/data"
"github.com/go-i2p/go-i2p/lib/util/logger"
"github.com/sirupsen/logrus"
@@ -329,7 +330,7 @@ func (delivery_instructions DeliveryInstructions) Fragmented() (bool, error) {
fragmented := (delivery_instructions[0] & 0x08) == 0x08
log.WithField("fragmented", fragmented).Debug("Fragmented status determined")
return fragmented, nil
//return ((delivery_instructions[0] & 0x08) == 0x08), nil
// return ((delivery_instructions[0] & 0x08) == 0x08), nil
}
log.Error("DeliveryInstructions contains no data")
return false, errors.New("DeliveryInstructions contains no data")
@@ -378,7 +379,7 @@ func (delivery_instructions DeliveryInstructions) HasTunnelID() (bool, error) {
log.WithError(err).Error("Failed to get DeliveryType")
return false, err
}
//return di_type == DT_TUNNEL, nil
// return di_type == DT_TUNNEL, nil
hasTunnelID := di_type == DT_TUNNEL
log.WithField("has_tunnel_id", hasTunnelID).Debug("HasTunnelID status determined")
return hasTunnelID, nil

View File

@@ -2,6 +2,7 @@ package tunnel
import (
"encoding/binary"
"github.com/sirupsen/logrus"
"github.com/go-i2p/go-i2p/lib/crypto"
@@ -161,7 +162,7 @@ func (decrypted_tunnel_message DecryptedTunnelMessage) deliveryInstructionData()
data_area := decrypted_tunnel_message[4+4+16:]
for i := 0; i < len(data_area); i++ {
if data_area[i] == 0x00 {
//return data_area[i+1:]
// return data_area[i+1:]
delivery_data := data_area[i+1:]
log.WithField("delivery_data_length", len(delivery_data)).Debug("Retrieved delivery instruction data")
return delivery_data