config shouln't even need to be nil.

This commit is contained in:
idk
2018-09-19 11:20:32 -04:00
parent 6f166d6cdd
commit 6e887f10e6
4 changed files with 21 additions and 11 deletions

View File

@ -19,10 +19,18 @@ echo:
mng:
cd manager && go test
test:
test: test-ntcp test-ssu test-config test-manager
test-ntcp:
go test
test-ssu:
cd udp && go test
test-config:
cd config && go test
test-manager:
cd manager && go test
deps:

View File

@ -81,12 +81,12 @@ I'm eventually going to make the manager implement net.Conn. This won't be
exposed in the default application probably though, but rather as a library.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAluiZ6oACgkQ11wDs5te
FOFA6AgAgQGjKlu4JOXYwViU6W8zhFWaQbGZSdpzH3ldYujn2fD3XA4ZunAWMhuc
akcL88ZdGxTTMSZg2cQLiIlkfSK5B0jhBTD9KApsM8D0cuq3jILQXmEjnv6r5Ndf
AfIAq5DUmSuWg41SEPZBBmmpJ2NIJpXR1aeQZxmCMJgwVD2jPqAFv6yotySSYg77
M6opkrVRclrUF1Vy5uK0h8ZJKibNpbTz9auNkgMPek6Q3JbFdK/JdehB4aX7CezB
KiVqU3Zi9+JAx8UhfCZImj+tRYndp2Hyv6ioEr5KtvAFbpFHN/wKe+TSc5o+cr/N
dHxia7kzjWyGL6EniPlkDwIHMtWUOw==
=L0Cx
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAluiaT8ACgkQ11wDs5te
FOHyjwf+PusbBvEqiTMXH2xVNzamPDfzVuwQPaPAm2EvaG8HmggtX07QeXlExzve
0qnhC28O00izrfUG0kZz1q1qij1hYq9cOt86bihg8FpEhZvqaScDHrH4LzSJsHyn
QB3TPYnOANR75RTW1qPf16kTLORSCM/vC3x5SHk5PSlPMA1OmBmgvLM9wMI2Bncc
WgJ3iFiTchZQXBw0n0/sCHn+qUsU+9thfGy5/UYHjlkZTMBHrdhP0+cmfDSMRQaM
tP3QZ+OvpQBdLyA96cL5X8BcF/D1a58plGNY5n9RB19aq/pgyOxYbZ2YM+mUvBYI
6r71h7CnmclZcwK0JrooNQD77qMW3A==
=Hbcq
-----END PGP SIGNATURE-----

View File

@ -172,9 +172,9 @@ func (c *Conf) Set(label ...string) {
func (c *Conf) I2PINILoad(iniFile string, label ...string) error {
var err error
c.exists = true
c.config = goini.New()
if iniFile != "none" && iniFile != "" {
c.FilePath = iniFile
c.config = goini.New()
err = c.config.ParseFile(iniFile)
if err != nil {
return err
@ -226,6 +226,7 @@ func (c *Conf) I2PINILoad(iniFile string, label ...string) error {
// NewI2PBlankTunConf returns an empty but intialized tunconf
func NewI2PBlankTunConf() *Conf {
var c Conf
c.config = goini.New()
return &c
}

View File

@ -243,7 +243,8 @@ func NewSAMManagerFromOptions(opts ...func(*SAMManager) error) (*SAMManager, err
if len(s.config.Labels) == 0 || s.start {
t, b := s.config.Get("type")
if !b {
return nil, fmt.Errorf("samcat was instructed to start a tunnel with insufficient default settings information.")
t = "client"
//return nil, fmt.Errorf("samcat was instructed to start a tunnel with insufficient default settings information.")
}
switch t {
case "http":