Skip to content

Commit 36a9c6d

Browse files
committed
Fix comment
1 parent df1217e commit 36a9c6d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: Sources/AsyncHTTPClient/ConnectionPool/HTTPRequestStateMachine.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ struct HTTPRequestStateMachine {
207207

208208
case .running(.streaming, .receivingBody(let responseHead, _)),
209209
.running(.endSent, .receivingBody(let responseHead, _)) where error as? NIOSSLError == .uncleanShutdown:
210-
211-
// if we have already received the response head, the parser will ensure that we receive
212-
// the complete response. we can ignore this error. we might see a HTTPParserError very
213-
// soon.
214210
if responseHead.headers.contains(name: "content-length") || responseHead.headers.contains(name: "transfer-encoding") {
211+
// If we have already received the response head, the parser will ensure that we
212+
// receive a complete response, if the content-length or transfer-encoding header
213+
// was set. In this case we can ignore the NIOSSLError.uncleanShutdown. We will see
214+
// a HTTPParserError very soon.
215215
return .wait
216216
}
217217

218-
// if the response is EOF terminated, we need to rely on a clean tls shutdown to be sure
218+
// If the response is EOF terminated, we need to rely on a clean tls shutdown to be sure
219219
// we have received all necessary bytes. For this reason we forward the uncleanShutdown
220220
// error to the user.
221221
self.state = .failed(error)

0 commit comments

Comments
 (0)