|
|
@ -213,14 +213,19 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// skip "ok" response
|
|
|
|
// skip "ooooooooook" response
|
|
|
|
trashHeader := []byte{0, 0}
|
|
|
|
trashHeader := []byte{0}
|
|
|
|
_, err = io.ReadFull(response.Body, trashHeader)
|
|
|
|
for {
|
|
|
|
if err != nil {
|
|
|
|
_, err = io.ReadFull(response.Body, trashHeader)
|
|
|
|
response.Body.Close()
|
|
|
|
if err != nil {
|
|
|
|
newError("failed to read initial response").Base(err).WriteToLog()
|
|
|
|
response.Body.Close()
|
|
|
|
gotDownResponse.Close()
|
|
|
|
newError("failed to read initial response").Base(err).WriteToLog()
|
|
|
|
return
|
|
|
|
gotDownResponse.Close()
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if trashHeader[0] == 'k' {
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
downResponse = response.Body
|
|
|
|
downResponse = response.Body
|
|
|
|