update sam3 libs to try fixing socket leaking in libi2ptorrent seeder

This commit is contained in:
jeff
2015-12-17 11:01:04 -05:00
parent 298b55c427
commit b51a8977cf
2 changed files with 6 additions and 9 deletions

View File

@ -225,8 +225,5 @@ func (sam *SAM) newGenericSession(style, id string, keys I2PKeys, options []stri
// close this sam session
func (sam *SAM) Close() error {
if err := sam.conn.Close(); err != nil {
return err
}
return nil
return sam.conn.Close()
}

View File

@ -170,25 +170,25 @@ func (l *StreamListener) Accept() (net.Conn, error) {
if err == nil {
// return wrapped connection
dest = strings.Trim(dest, "\n")
return SAMConn{
return &SAMConn{
laddr: l.laddr,
raddr: I2PAddr(dest),
conn: s.conn,
}, nil
} else {
s.conn.Close()
s.Close()
return nil, err
}
} else {
s.conn.Close()
s.Close()
return nil, errors.New("invalid sam line: "+line)
}
} else {
s.conn.Close()
s.Close()
return nil, err
}
} else {
s.conn.Close()
s.Close()
return nil, err
}
}