mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 11:23:32 +02:00
SplitHTTP: ok -> ooooooooook (parser in client)
https://github.com/XTLS/Xray-core/pull/3479#issuecomment-2196370334
This commit is contained in:
parent
c0f3bf66fd
commit
8320732743
1 changed files with 13 additions and 8 deletions
|
@ -213,14 +213,19 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||
return
|
||||
}
|
||||
|
||||
// skip "ok" response
|
||||
trashHeader := []byte{0, 0}
|
||||
_, err = io.ReadFull(response.Body, trashHeader)
|
||||
if err != nil {
|
||||
response.Body.Close()
|
||||
newError("failed to read initial response").Base(err).WriteToLog()
|
||||
gotDownResponse.Close()
|
||||
return
|
||||
// skip "ooooooooook" response
|
||||
trashHeader := []byte{0}
|
||||
for {
|
||||
_, err = io.ReadFull(response.Body, trashHeader)
|
||||
if err != nil {
|
||||
response.Body.Close()
|
||||
newError("failed to read initial response").Base(err).WriteToLog()
|
||||
gotDownResponse.Close()
|
||||
return
|
||||
}
|
||||
if trashHeader[0] == 'k' {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
downResponse = response.Body
|
||||
|
|
Loading…
Reference in a new issue