Skip to content

Commit fb18932

Browse files
author
drovosek229
committed
SplitHTTP: ok -> ooooooooook (parser in client)
XTLS#3479 (comment)
1 parent 7b49257 commit fb18932

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

transport/internet/splithttp/dialer.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,19 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
213213
return
214214
}
215215

216-
// skip "ok" response
217-
trashHeader := []byte{0, 0}
218-
_, err = io.ReadFull(response.Body, trashHeader)
219-
if err != nil {
220-
response.Body.Close()
221-
newError("failed to read initial response").Base(err).WriteToLog()
222-
gotDownResponse.Close()
223-
return
216+
// skip "ooooooooook" response
217+
trashHeader := []byte{0}
218+
for {
219+
_, err = io.ReadFull(response.Body, trashHeader)
220+
if err != nil {
221+
response.Body.Close()
222+
newError("failed to read initial response").Base(err).WriteToLog()
223+
gotDownResponse.Close()
224+
return
225+
}
226+
if trashHeader[0] == 'k' {
227+
break
228+
}
224229
}
225230

226231
downResponse = response.Body

0 commit comments

Comments
 (0)