Skip to content

Commit

Permalink
Move flush back into synchronized output.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 24, 2024
1 parent 7ccef53 commit 03c9dcb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/protocol/http2/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,20 @@ def receive_goaway(frame)
def write_frame(frame)
synchronize do
@framer.write_frame(frame)

# I tried moving this outside the synchronize block but it caused a deadlock.
@framer.flush
end

# The IO is already synchronized, and we don't want additional contention.
@framer.flush
end

def write_frames
if @framer
synchronize do
yield @framer

# See note above.
@framer.flush
end

# See above note.
@framer.flush
else
raise EOFError, "Connection closed!"
end
Expand Down

0 comments on commit 03c9dcb

Please sign in to comment.