small fixes for i2pd
This commit is contained in:
@ -2,6 +2,7 @@ package goSam
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Lookup askes SAM for the internal i2p address from name
|
||||
@ -25,8 +26,12 @@ func (c *Client) Lookup(name string) (addr string, err error) {
|
||||
}
|
||||
|
||||
if r.Pairs["NAME"] != name {
|
||||
err = fmt.Errorf("i2p Replyed to another name.\nWanted:%s\nGot: %+v\n", name, r)
|
||||
return
|
||||
// somehow different on i2pd
|
||||
if r.Pairs["NAME"] != "ME" {
|
||||
err = fmt.Errorf("Lookup() Replyed to another name.\nWanted:%s\nGot: %+v\n", name, r)
|
||||
return
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, "WARNING: Lookup() Replyed to another name. assuming i2pd c++ fluke")
|
||||
}
|
||||
|
||||
addr = r.Pairs["VALUE"]
|
||||
|
@ -4,8 +4,13 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
// CreateStreamSession creates a new STREAM Session.
|
||||
// Returns the Id for the new Client.
|
||||
func (c *Client) CreateStreamSession(dest string) (id int32, newDest string, err error) {
|
||||
|
Reference in New Issue
Block a user