Skip to content
Browse files

Wow! Fixed wrong invokation of reply to NetConnection.call

  • Loading branch information...
1 parent 7a33bb1 commit e8edbea5c41cba76835ff818bcae5312bfff313d @maxlapshin maxlapshin committed
Showing with 13 additions and 5 deletions.
  1. +1 −0 Emakefile
  2. +8 −2 src/amf0.erl
  3. +1 −1 src/apps/apps_rtmp.erl
  4. +0 −1 src/media/media_provider.erl
  5. +2 −0 src/plugins/.gitignore
  6. +1 −1 src/rtmp.erl
View
1 Emakefile
@@ -3,6 +3,7 @@
{"src/apps/*", [{d, debug}, {outdir, "ebin"}, {i, "include"}]}.
{"src/media/*", [{d, debug}, {outdir, "ebin"}, {i, "include"}]}.
{"src/formats/*", [{d, debug}, {outdir, "ebin"}, {i, "include"}]}.
+{"src/plugins/*", [{d, debug}, {outdir, "ebin"}, {i, "include"}]}.
{"deps/misultin/src/*", [{outdir, "ebin"}, {i, "deps/misultin/include"}]}.
{"deps/erlydtl-0.5.3/src/erlydtl/*", [{outdir, "ebin"}, {i, "deps/erlydtl-0.5.3/include"}]}.
% debug_info, bin_opt_info,
View
10 src/amf0.erl
@@ -120,8 +120,14 @@ decode_list(List, Data) ->
decode(Bin) ->
{string, Command, Rest} = parse(Bin),
FullArguments = decode_list([], Rest),
- [_Num | Arguments] = FullArguments,
- #amf{command = list_to_atom(Command), args = Arguments, type = invoke}.
+ % ?D({"Rest", Rest, FullArguments}),
+ case FullArguments of
+ [{number, Id} | Arguments] -> #amf{command = list_to_atom(Command), args = Arguments, type = invoke, id = Id};
+ Arguments -> #amf{command = list_to_atom(Command), args = Arguments, type = notify}
+ end.
+ % [{number, Id} | Arguments] = FullArguments,
+ % #amf{command = list_to_atom(Command), args = Arguments, type = invoke, id = Id}.
+
% case parse(Rest) of
% {{mixed_array, Rest2}, _Rest3} -> %without id, set type to notify
% Args = decode_args(Rest2, []),
View
2 src/apps/apps_rtmp.erl
@@ -99,7 +99,7 @@ connect(AMF, #rtmp_client{window_size = WindowAckSize} = State) ->
reply(Id, Args) ->
gen_fsm:send_event(self(), {invoke, #amf{
command = '_result',
- id = Id, %% muriel: dirty too, but the only way I can make this work
+ id = Id,
type = invoke,
args= Args}}).
View
1 src/media/media_provider.erl
@@ -133,7 +133,6 @@ open_media_entry({Name, Type}, #media_provider{opened_media = OpenedMedia} = Med
undefined ->
case ems_sup:start_media(Name, Type) of
{ok, Pid} ->
- ?D({"ZZZ:", Type, Pid}),
link(Pid),
ets:insert(OpenedMedia, #media_entry{name = Name, handler = Pid}),
?D({"Opened", Type, Name, Pid}),
View
2 src/plugins/.gitignore
@@ -0,0 +1,2 @@
+*.erl
+
View
2 src/rtmp.erl
@@ -272,7 +272,7 @@ command(#channel{type = Type}, State) ->
State.
call_function(unhandled, Command, #rtmp_client{addr = IP, port = Port} = State, #amf{args = Args}) ->
- error_logger:error_msg("Client ~p:~p requested unknown function ~p/~p", [IP, Port, Command, length(Args)]),
+ error_logger:error_msg("Client ~p:~p requested unknown function ~p/~p~n", [IP, Port, Command, length(Args)]),
State;
call_function(App, Command, State, AMF) ->

0 comments on commit e8edbea

Please sign in to comment.
Something went wrong with that request. Please try again.