mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-07 21:04:42 +00:00
fix: state
This commit is contained in:
@@ -225,7 +225,7 @@ func smuxConfig() *smux.Config {
|
||||
}
|
||||
|
||||
func (c *Client) handleReconnect() {
|
||||
logger.Infof("client link reconnect — tearing down smux session")
|
||||
logger.Infof("client link reconnect - tearing down smux session")
|
||||
c.sessMu.Lock()
|
||||
if c.session != nil {
|
||||
_ = c.session.Close()
|
||||
|
||||
@@ -229,7 +229,7 @@ func (s *Server) installSession() {
|
||||
}
|
||||
|
||||
func (s *Server) handleReconnect() {
|
||||
logger.Infof("server link reconnect — tearing down smux session")
|
||||
logger.Infof("server link reconnect - tearing down smux session")
|
||||
s.sessMu.RLock()
|
||||
current := s.session
|
||||
s.sessMu.RUnlock()
|
||||
@@ -296,7 +296,7 @@ func (s *Server) serve(ctx context.Context) {
|
||||
return
|
||||
default:
|
||||
}
|
||||
logger.Infof("AcceptStream returned %v — reinstalling session", err)
|
||||
logger.Infof("AcceptStream returned %v - reinstalling session", err)
|
||||
s.reinstallSession(sess)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// Both peers establish a KCP session with the same convid. KCP does not
|
||||
// require a handshake — packets are matched by conv field, so a static
|
||||
// require a handshake - packets are matched by conv field, so a static
|
||||
// constant gives us a symmetrical P2P setup.
|
||||
const kcpConvID = 0xC0FFEE01
|
||||
|
||||
@@ -24,7 +24,7 @@ const (
|
||||
kcpMTU = 1400
|
||||
|
||||
// Receive/send window in segments. Large window allows in-flight bursts
|
||||
// without stalling — important when one VP8 frame may carry many KCP
|
||||
// without stalling - important when one VP8 frame may carry many KCP
|
||||
// segments and ACKs trickle back at frame cadence.
|
||||
kcpSndWnd = 4096
|
||||
kcpRcvWnd = 4096
|
||||
@@ -99,7 +99,7 @@ func (r *kcpRuntime) readLoop(onData func([]byte)) {
|
||||
continue
|
||||
}
|
||||
if size > kcpMaxMessage {
|
||||
// Stream framing is now corrupted — there is no safe way to
|
||||
// Stream framing is now corrupted - there is no safe way to
|
||||
// resync without a session reset. Bail and let the upper layer
|
||||
// reconnect.
|
||||
return
|
||||
|
||||
@@ -41,7 +41,7 @@ func newKCPConn(out chan<- []byte, inboundCap int) *kcpConn {
|
||||
}
|
||||
|
||||
// deliver hands an incoming wire payload to the KCP read loop. Drops on
|
||||
// overflow are intentional — KCP will detect the loss via SACK and retransmit.
|
||||
// overflow are intentional - KCP will detect the loss via SACK and retransmit.
|
||||
func (c *kcpConn) deliver(payload []byte) {
|
||||
cp := make([]byte, len(payload))
|
||||
copy(cp, payload)
|
||||
|
||||
Reference in New Issue
Block a user