- Implement remote addr for conn

- Eliminate cached offeranswer arguments
- Fix exponent reset in conn reconnect loop
- Fix on disconnected callback for permanent server
- Add peer relay status for status details command
This commit is contained in:
Zoltán Papp
2024-07-16 11:02:32 +02:00
parent add4e9f4e4
commit 4ea55bfe3c
16 changed files with 544 additions and 357 deletions

View File

@@ -11,14 +11,16 @@ type Conn struct {
dstID []byte
dstStringID string
messageChan chan Msg
instanceURL *RelayAddr
}
func NewConn(client *Client, dstID []byte, dstStringID string, messageChan chan Msg) *Conn {
func NewConn(client *Client, dstID []byte, dstStringID string, messageChan chan Msg, instanceURL *RelayAddr) *Conn {
c := &Conn{
client: client,
dstID: dstID,
dstStringID: dstStringID,
messageChan: messageChan,
instanceURL: instanceURL,
}
return c
@@ -48,7 +50,7 @@ func (c *Conn) LocalAddr() net.Addr {
}
func (c *Conn) RemoteAddr() net.Addr {
return c.client.relayConn.RemoteAddr()
return c.instanceURL
}
func (c *Conn) SetDeadline(t time.Time) error {