aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gun.erl b/src/gun.erl
index a8b76f8..55e70dd 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -436,7 +436,12 @@ request(ServerPid, Method, Path, Headers, Body, ReqOpts) ->
-spec data(pid(), reference(), fin | nofin, iodata()) -> ok.
data(ServerPid, StreamRef, IsFin, Data) ->
- gen_statem:cast(ServerPid, {data, self(), StreamRef, IsFin, Data}).
+ case iolist_size(Data) of
+ 0 when IsFin =:= nofin ->
+ ok;
+ _ ->
+ gen_statem:cast(ServerPid, {data, self(), StreamRef, IsFin, Data})
+ end.
%% Tunneling.