Skip to content

Commit

Permalink
send notification back when received DATA frame
Browse files Browse the repository at this point in the history
It’s a very simple implement. Check other issues:
joedevivo#57
joedevivo#73
  • Loading branch information
tony612 committed Oct 1, 2016
1 parent d59b541 commit 98d2d07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/h2_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1582,5 +1582,15 @@ recv_data(Stream, Frame) ->
%% anyway.
ok;
Pid ->
NotifyPid = h2_stream_set:notify_pid(Stream),
recv_data_cb(NotifyPid, Frame),
gen_fsm:send_event(Pid, {recv_data, Frame})
end.

recv_data_cb(Pid, {#frame_header{
flags=Flags,
type=?DATA
}, Payload}) ->
Bin = h2_frame_data:data(Payload),
Pid ! {'RECV_DATA', Bin};
recv_data_cb(_, _) -> ok.

0 comments on commit 98d2d07

Please sign in to comment.