Skip to content

Commit 4356975

Browse files
authored
#flush is already synchronised. (#17)
1 parent 57ef23f commit 4356975

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/protocol/http2/connection.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,20 @@ def receive_goaway(frame)
214214
def write_frame(frame)
215215
synchronize do
216216
@framer.write_frame(frame)
217-
@framer.flush
218217
end
218+
219+
# The IO is already synchronized, and we don't want additional contention.
220+
@framer.flush
219221
end
220222

221223
def write_frames
222224
if @framer
223225
synchronize do
224226
yield @framer
225-
@framer.flush
226227
end
228+
229+
# See above note.
230+
@framer.flush
227231
else
228232
raise EOFError, "Connection closed!"
229233
end

0 commit comments

Comments
 (0)