Send trailer and close socket explicitly on stream end

This commit is contained in:
Evgeniy Khramtsov 2018-06-01 07:58:03 +03:00
parent 1261502f6a
commit 4fc8d1c4a4
1 changed files with 1 additions and 2 deletions

View File

@ -459,8 +459,7 @@ process_invalid_xml(#{lang := MyLang} = State, El, Reason) ->
process_stream_end(_, #{stream_state := disconnected} = State) ->
State;
process_stream_end(Reason, State) ->
State1 = State#{stream_timeout => infinity,
stream_state => disconnected},
State1 = send_trailer(State),
try callback(handle_stream_end, Reason, State1)
catch _:{?MODULE, undef} -> stop(State1)
end.