feat(wip): udp rework client side

This commit is contained in:
Toby 2023-07-24 16:32:25 -07:00
parent f142a24047
commit cbedb27f0f
7 changed files with 391 additions and 391 deletions

View file

@ -106,25 +106,4 @@ func TestServerMasquerade(t *testing.T) {
if nErr, ok := err.(net.Error); !ok || !nErr.Timeout() {
t.Fatal("expected timeout, got", err)
}
// Try UDP request
udpStream, err := conn.OpenStream()
if err != nil {
t.Fatal("error opening stream:", err)
}
defer udpStream.Close()
err = protocol.WriteUDPRequest(udpStream)
if err != nil {
t.Fatal("error sending request:", err)
}
// We should receive nothing
_ = udpStream.SetReadDeadline(time.Now().Add(2 * time.Second))
n, err = udpStream.Read(buf)
if n != 0 {
t.Fatal("expected no response, got", n)
}
if nErr, ok := err.(net.Error); !ok || !nErr.Timeout() {
t.Fatal("expected timeout, got", err)
}
}

View file

@ -287,7 +287,7 @@ func (l *channelEventLogger) TCPError(addr net.Addr, id, reqAddr string, err err
}
}
func (l *channelEventLogger) UDPRequest(addr net.Addr, id string, sessionID uint32) {
func (l *channelEventLogger) UDPRequest(addr net.Addr, id string, sessionID uint32, reqAddr string) {
if l.UDPRequestEventCh != nil {
l.UDPRequestEventCh <- udpRequestEvent{
Addr: addr,