mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-26 11:44:22 -04:00
Check Read
This commit is contained in:
parent
32e8deb6e8
commit
22519353c3
@ -21,6 +21,10 @@ func Test_Connect_ws(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
conn.Read(buf)
|
conn.Read(buf)
|
||||||
|
str := string(buf)
|
||||||
|
if str != "echo" {
|
||||||
|
assert.Fail("Data mismatch")
|
||||||
|
}
|
||||||
s <- 0
|
s <- 0
|
||||||
}()
|
}()
|
||||||
<-s
|
<-s
|
||||||
@ -37,6 +41,10 @@ func Test_Connect_wss(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
conn.Read(buf)
|
conn.Read(buf)
|
||||||
|
str := string(buf)
|
||||||
|
if str != "echo" {
|
||||||
|
assert.Fail("Data mismatch")
|
||||||
|
}
|
||||||
s <- 0
|
s <- 0
|
||||||
}()
|
}()
|
||||||
<-s
|
<-s
|
||||||
@ -53,6 +61,10 @@ func Test_Connect_wss_1_nil(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
conn.Read(buf)
|
conn.Read(buf)
|
||||||
|
str := string(buf)
|
||||||
|
if str != "echo" {
|
||||||
|
assert.Fail("Data mismatch")
|
||||||
|
}
|
||||||
s <- 0
|
s <- 0
|
||||||
}()
|
}()
|
||||||
<-s
|
<-s
|
||||||
@ -69,6 +81,10 @@ func Test_Connect_ws_guess(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
conn.Read(buf)
|
conn.Read(buf)
|
||||||
|
str := string(buf)
|
||||||
|
if str != "echo" {
|
||||||
|
assert.Fail("Data mismatch")
|
||||||
|
}
|
||||||
s <- 0
|
s <- 0
|
||||||
}()
|
}()
|
||||||
<-s
|
<-s
|
||||||
@ -85,6 +101,10 @@ func Test_Connect_wss_guess(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
conn.Read(buf)
|
conn.Read(buf)
|
||||||
|
str := string(buf)
|
||||||
|
if str != "echo" {
|
||||||
|
assert.Fail("Data mismatch")
|
||||||
|
}
|
||||||
s <- 0
|
s <- 0
|
||||||
}()
|
}()
|
||||||
<-s
|
<-s
|
||||||
@ -117,6 +137,10 @@ func Test_Connect_wss_guess_reuse(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 4)
|
buf := make([]byte, 4)
|
||||||
conn.Read(buf)
|
conn.Read(buf)
|
||||||
|
str := string(buf)
|
||||||
|
if str != "echo" {
|
||||||
|
assert.Fail("Data mismatch")
|
||||||
|
}
|
||||||
s <- 0
|
s <- 0
|
||||||
}()
|
}()
|
||||||
<-s
|
<-s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user