Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix backpressure-related TCPConnection busy-loop bug (issue ponylang#2620).
  • Loading branch information
slfritchie authored and dipinhora committed Jun 5, 2018
1 parent 4038d1b commit 13c6ac0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/net/tcp_connection.pony
Original file line number Diff line number Diff line change
Expand Up @@ -948,17 +948,16 @@ actor TCPConnection
fun ref _apply_backpressure() =>
if not _throttled then
_throttled = true
ifdef not windows then
_writeable = false

// this is safe because asio thread isn't currently subscribed
// for a write event so will not be writing to the readable flag
@pony_asio_event_set_writeable(_event, false)
@pony_asio_event_resubscribe_write(_event)
end

_notify.throttled(this)
end
ifdef not windows then
_writeable = false

// this is safe because asio thread isn't currently subscribed
// for a write event so will not be writing to the readable flag
@pony_asio_event_set_writeable(_event, false)
@pony_asio_event_resubscribe_write(_event)
end

fun ref _release_backpressure() =>
if _throttled then
Expand Down

0 comments on commit 13c6ac0

Please sign in to comment.