mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Correctly calculate remaining bytes on file upload
This commit is contained in:
parent
db51d522e8
commit
d2114be6f3
@ -617,7 +617,7 @@ do_recv_file(Len, SockMod, Socket, Fd) ->
|
||||
try
|
||||
{ok, Data} = SockMod:recv(Socket, ChunkLen, timer:seconds(30)),
|
||||
ok = file:write(Fd, Data),
|
||||
do_recv_file(Len-ChunkLen, SockMod, Socket, Fd)
|
||||
do_recv_file(Len-size(Data), SockMod, Socket, Fd)
|
||||
catch _:{badmatch, {error, _} = Err} ->
|
||||
file:close(Fd),
|
||||
Err
|
||||
|
Loading…
Reference in New Issue
Block a user