Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
56cca2e537 | ||
![]() |
9ca67baa32 |
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
|
||||
USER_GH=eyedeekay
|
||||
VERSION=0.33.3
|
||||
VERSION=0.33.4
|
||||
packagename=sam3
|
||||
|
||||
echo:
|
||||
|
@@ -171,7 +171,11 @@ func (sam *PrimarySession) ResolveUDPAddr(network, dest string) (net.Addr, error
|
||||
// Creates a new PrimarySession with the I2CP- and streaminglib options as
|
||||
// specified. See the I2P documentation for a full list of options.
|
||||
func (sam *SAM) NewPrimarySession(id string, keys i2pkeys.I2PKeys, options []string) (*PrimarySession, error) {
|
||||
conn, err := sam.newGenericSession(PrimarySessionSwitch, id, keys, options, []string{})
|
||||
return sam.newPrimarySession(PrimarySessionSwitch, id, keys, options)
|
||||
}
|
||||
|
||||
func (sam *SAM) newPrimarySession(primarySessionSwitch string, id string, keys i2pkeys.I2PKeys, options []string) (*PrimarySession, error) {
|
||||
conn, err := sam.newGenericSession(primarySessionSwitch, id, keys, options, []string{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -65,6 +65,22 @@ func PrimarySessionString() string {
|
||||
if err != nil {
|
||||
return "MASTER"
|
||||
}
|
||||
// at this point we're probably running on Java I2P and thus probably
|
||||
// have a PRIMARY session. Just to be sure, try to make one, check
|
||||
// for errors, then immediately close it.
|
||||
testSam, err := NewSAM(SAMDefaultAddr(""))
|
||||
if err != nil {
|
||||
return "MASTER"
|
||||
}
|
||||
newKeys, err := testSam.NewKeys()
|
||||
if err != nil {
|
||||
return "MASTER"
|
||||
}
|
||||
primarySession, err := testSam.newPrimarySession("PRIMARY", "primaryTestTunnel", newKeys, Options_Small)
|
||||
if err != nil {
|
||||
return "MASTER"
|
||||
}
|
||||
primarySession.Close()
|
||||
return "PRIMARY"
|
||||
}
|
||||
return "MASTER"
|
||||
|
Reference in New Issue
Block a user