= join $
atomically $
do state ← readTVar $ itrState itr
- if state ≡ GettingBody then
+ if state ≡ ReceivingBody then
writeContinueIfNeeded ctx itr phase
else
- if state ≥ DecidingBody then
+ if state ≥ SendingBody then
writeHeaderOrBodyIfNeeded ctx itr phase
else
retry
→ STM (IO ())
writeContinueIfNeeded ctx itr@(Interaction {..}) phase
| phase ≡ Initial ∧ itrExpectedContinue ≡ Just True
- = do isRequested ← isEmptyTMVar itrGetBodyRequest
+ = do isRequested ← isEmptyTMVar itrReceiveBodyReq
if isRequested then
return $ writeContinue ctx itr
else