Skip to content

Commit 1bac474

Browse files
committed
Cancel timeout on idleTimeoutStage if we couldn't set a timeout
1 parent ca1c5c2 commit 1bac474

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

blaze-client/src/main/scala/org/http4s/blaze/client/Http1Connection.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ private final class Http1Connection[F[_]](
179179

180180
override protected def contentComplete(): Boolean = parser.contentComplete()
181181

182-
private[this] val noopCancel = Some(F.unit)
183-
184182
private def executeRequest(
185183
req: Request[F],
186184
cancellation: F[TimeoutException],
@@ -218,7 +216,7 @@ private final class Http1Connection[F[_]](
218216
val idleTimeoutF: F[TimeoutException] = idleTimeoutStage match {
219217
case Some(stage) =>
220218
F.async[TimeoutException] { cb =>
221-
F.delay(stage.setTimeout(cb)).as(noopCancel)
219+
F.delay(stage.setTimeout(cb)).as(Some(F.delay(stage.cancelTimeout())))
222220
}
223221
case None => F.never[TimeoutException]
224222
}

0 commit comments

Comments
 (0)