From 0c1113fa563b400eeaea0c933a10353b71b53084 Mon Sep 17 00:00:00 2001 From: Kenneth Lakin Date: Tue, 10 Nov 2015 01:40:44 -0800 Subject: [PATCH] Maybe fixes Issue #95 Some spelunking leads me to believe that commit 0243a27304faf0c58eff74103757eaa2229a37b7 accidentally replaced a queue append operation with an assignment of the return value of gen_fsm:reply/2, (whose return value you are supposed to ignore.). This value was then assigned to the responses key in the FSM's state map, which was only *supposed* to contain data of type queue:queue(). This commit restores the queue append operation, and *appears* to address Issue #95. --- src/shotgun.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shotgun.erl b/src/shotgun.erl index 459ad7f..a4f392e 100644 --- a/src/shotgun.erl +++ b/src/shotgun.erl @@ -440,7 +440,8 @@ wait_response({gun_response, _Pid, _StreamRef, fin, StatusCode, Headers}, gen_fsm:reply(From, {ok, Response}), Responses; true -> - gen_fsm:reply(From, {ok, Response}) + gen_fsm:reply(From, {ok, Response}), + queue:in(Response, Responses) end, {next_state, at_rest, State#{responses => NewResponses}, 0}; wait_response({gun_response, _Pid, _StreamRef, nofin, StatusCode, Headers},