Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #79 from t2y/development
Browse files Browse the repository at this point in the history
Fxied to call _send_cb() instead of _data_cb() for PingFrame

Thanks to @t2y!
  • Loading branch information
Lukasa committed Jan 24, 2015
2 parents e530d18 + 0fa1d68 commit 7978b2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hyper/http20/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def receive_frame(self, frame):
p = PingFrame(0)
p.flags.add('ACK')
p.opaque_data = frame.opaque_data
self._data_cb(p, True)
self._send_cb(p, True)
elif frame.type == SettingsFrame.type:
if 'ACK' not in frame.flags:
self._update_settings(frame)
Expand Down
4 changes: 2 additions & 2 deletions test/test_hyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ def test_ping_with_ack_ignored(self):

def data_cb(frame, tolerate_peer_gone=False):
assert False, 'should not be called'
c._data_cb = data_cb
c._send_cb = data_cb
c.receive_frame(f)

def test_ping_without_ack_gets_reply(self):
Expand All @@ -1285,7 +1285,7 @@ def test_ping_without_ack_gets_reply(self):

def data_cb(frame, tolerate_peer_gone=False):
frames.append(frame)
c._data_cb = data_cb
c._send_cb = data_cb
c.receive_frame(f)

assert len(frames) == 1
Expand Down

0 comments on commit 7978b2a

Please sign in to comment.