mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
fix: create sever on each pconn
This commit is contained in:
parent
ad1633e9fe
commit
8316deb144
1 changed files with 11 additions and 11 deletions
22
u_oscur0.go
22
u_oscur0.go
|
@ -37,7 +37,7 @@ func Oscur0Client(pconn net.PacketConn, addr net.Addr, oscur0Conf *Oscur0Config)
|
||||||
return econn, nil
|
return econn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseServerMap map[string]*baseServer = map[string]*baseServer{}
|
// var baseServerMap map[string]*baseServer = map[string]*baseServer{}
|
||||||
|
|
||||||
func Oscur0Server(pconn net.PacketConn, addr net.Addr, oscur0Conf *Oscur0Config) (Connection, error) {
|
func Oscur0Server(pconn net.PacketConn, addr net.Addr, oscur0Conf *Oscur0Config) (Connection, error) {
|
||||||
keyLogWriter, err := os.Create("./server_keylog.txt")
|
keyLogWriter, err := os.Create("./server_keylog.txt")
|
||||||
|
@ -50,17 +50,17 @@ func Oscur0Server(pconn net.PacketConn, addr net.Addr, oscur0Conf *Oscur0Config)
|
||||||
ConnectionIDLength: len(oscur0Conf.ClientConnID),
|
ConnectionIDLength: len(oscur0Conf.ClientConnID),
|
||||||
}
|
}
|
||||||
|
|
||||||
server, ok := baseServerMap[pconn.LocalAddr().String()]
|
// server, ok := baseServerMap[pconn.LocalAddr().String()]
|
||||||
if !ok {
|
// if !ok {
|
||||||
server, err = tp.createServer(&tls.Config{
|
server, err := tp.createServer(&tls.Config{
|
||||||
NextProtos: []string{"h3"},
|
NextProtos: []string{"h3"},
|
||||||
KeyLogWriter: keyLogWriter,
|
KeyLogWriter: keyLogWriter,
|
||||||
}, &Config{}, true)
|
}, &Config{}, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
|
||||||
baseServerMap[pconn.LocalAddr().String()] = server
|
|
||||||
}
|
}
|
||||||
|
// baseServerMap[pconn.LocalAddr().String()] = server
|
||||||
|
// }
|
||||||
|
|
||||||
return server.Oscur0Accept(addr, oscur0Conf)
|
return server.Oscur0Accept(addr, oscur0Conf)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue