Fix missing HandshakeConn interface

This commit is contained in:
世界 2023-08-11 19:19:55 +08:00
parent ea4a972acd
commit dc1639b520
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 28 additions and 0 deletions

View file

@ -20,6 +20,10 @@ type serverConn struct {
responseWritten bool
}
func (c *serverConn) NeedHandshake() bool {
return !c.responseWritten
}
func (c *serverConn) HandshakeFailure(err error) error {
errMessage := err.Error()
buffer := buf.NewSize(1 + rw.UVariantLen(uint64(len(errMessage))) + len(errMessage))
@ -85,6 +89,10 @@ type serverPacketConn struct {
responseWritten bool
}
func (c *serverPacketConn) NeedHandshake() bool {
return !c.responseWritten
}
func (c *serverPacketConn) HandshakeFailure(err error) error {
errMessage := err.Error()
buffer := buf.NewSize(1 + rw.UVariantLen(uint64(len(errMessage))) + len(errMessage))
@ -186,6 +194,10 @@ type serverPacketAddrConn struct {
responseWritten bool
}
func (c *serverPacketAddrConn) NeedHandshake() bool {
return !c.responseWritten
}
func (c *serverPacketAddrConn) HandshakeFailure(err error) error {
errMessage := err.Error()
buffer := buf.NewSize(1 + rw.UVariantLen(uint64(len(errMessage))) + len(errMessage))