mirror of
https://github.com/SagerNet/sing-mux.git
synced 2025-04-04 20:37:44 +03:00
Fix missing HandshakeConn interface
This commit is contained in:
parent
ea4a972acd
commit
dc1639b520
3 changed files with 28 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue