mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-04 16:37:12 -05:00
VMess will Drain Connection On Auth failure
This commit is contained in:
parent
220b783caa
commit
38e89bd2c7
@ -155,7 +155,7 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
|||||||
|
|
||||||
user, timestamp, valid := s.userValidator.Get(buffer.Bytes())
|
user, timestamp, valid := s.userValidator.Get(buffer.Bytes())
|
||||||
if !valid {
|
if !valid {
|
||||||
return nil, newError("invalid user")
|
return nil, drainConnection(newError("invalid user"))
|
||||||
}
|
}
|
||||||
|
|
||||||
iv := hashTimestamp(md5.New(), timestamp)
|
iv := hashTimestamp(md5.New(), timestamp)
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -265,7 +266,9 @@ func TestCommanderAddRemoveUser(t *testing.T) {
|
|||||||
common.Must(err)
|
common.Must(err)
|
||||||
defer CloseAllServers(servers)
|
defer CloseAllServers(servers)
|
||||||
|
|
||||||
if err := testTCPConn(clientPort, 1024, time.Second*5)(); err != io.EOF {
|
if err := testTCPConn(clientPort, 1024, time.Second*5)(); err != io.EOF &&
|
||||||
|
/*We might wish to drain the connection*/
|
||||||
|
(err != nil && !strings.HasSuffix(err.Error(), "i/o timeout")) {
|
||||||
t.Fatal("expected error: ", err)
|
t.Fatal("expected error: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user