Skip to content
Snippets Groups Projects
Commit 2a371994 authored by Anatolii Kurotych's avatar Anatolii Kurotych
Browse files

[*] Fix reset buf_out_size if send is error

parent 0112c22d
No related branches found
No related tags found
No related merge requests found
......@@ -217,7 +217,8 @@ static void read_write_cb (struct ev_loop* loop, struct ev_io* watcher, int reve
}
else
{
for(size_t total_sent = 0; total_sent < dap_cur->buf_out_size;) {
size_t total_sent = 0;
for(; total_sent < dap_cur->buf_out_size;) {
//log_it(DEBUG, "Output: %u from %u bytes are sent ", total_sent, dap_cur->buf_out_size);
ssize_t bytes_sent = send(dap_cur->socket,
dap_cur->buf_out + total_sent,
......@@ -230,7 +231,7 @@ static void read_write_cb (struct ev_loop* loop, struct ev_io* watcher, int reve
total_sent += (size_t)bytes_sent;
dap_cur->download_stat.buf_size_total += (size_t)bytes_sent;
}
dap_cur->buf_out_size = 0;
dap_cur->buf_out_size -= total_sent;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment