Skip to content

Commit

Permalink
修复 DPD-REQ 协议
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdgy committed Dec 31, 2023
1 parent 970213f commit 2e86547
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/handler/link_cstp.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio
case 0x03: // DPD-REQ
// base.Debug("recv DPD-REQ", cSess.IpAddr)
pl.PType = 0x04
pl.Data = pl.Data[:n]
if payloadOutCstp(cSess, pl) {
return
}
Expand Down Expand Up @@ -168,7 +169,7 @@ func cstpWrite(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessi
binary.BigEndian.PutUint16(pl.Data[4:6], uint16(l))
}
} else {
pl.Data = append(pl.Data[:0], plHeader...)
// pl.Data = append(pl.Data[:0], plHeader...)
// 设置头类型
pl.Data[6] = pl.PType
}
Expand Down
1 change: 1 addition & 0 deletions server/handler/link_dtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func dtlsWrite(conn net.Conn, dSess *sessdata.DtlsSession, cSess *sessdata.ConnS
}
} else {
// 设置头类型
// pl.Data = append(pl.Data[:0], pl.PType)
pl.Data[0] = pl.PType
}
n, err := conn.Write(pl.Data)
Expand Down

0 comments on commit 2e86547

Please sign in to comment.