mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
THRIFT-3423 First call to thrift_transport:read_exact fails to dispatch correct function
Client: Erlang Patch: Nobuaki Sukegawa This closes #694
This commit is contained in:
parent
7f404fdef2
commit
97a48988de
@ -101,11 +101,14 @@ when is_integer(Len), Len >= 0 ->
|
|||||||
|
|
||||||
read_exact(Transport = #t_transport{module = Module}, Len)
|
read_exact(Transport = #t_transport{module = Module}, Len)
|
||||||
when is_integer(Len), Len >= 0 ->
|
when is_integer(Len), Len >= 0 ->
|
||||||
case erlang:function_exported(Module, read_exact, 2) of
|
case lists:keyfind(read_exact, 1, Module:module_info(exports)) of
|
||||||
true ->
|
{read_exact, 2} ->
|
||||||
{NewState, Result} = Module:read_exact(Transport#t_transport.state, Len),
|
io:fwrite("HAS EXACT"),
|
||||||
{Transport#t_transport{state = NewState}, Result};
|
{NewState, Result} = Module:read_exact(Transport#t_transport.state, Len),
|
||||||
false -> read(Transport, Len)
|
{Transport#t_transport{state = NewState}, Result};
|
||||||
|
_ ->
|
||||||
|
io:fwrite("~p NO EXACT", [Module]),
|
||||||
|
read(Transport, Len)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user