small fixes for i2pd

This commit is contained in:
Henry
2015-02-05 11:52:28 +01:00
parent 8badb1ef70
commit 8bb78fd8f4
2 changed files with 12 additions and 2 deletions

View File

@ -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"]