Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi_download::stop()方法调用时,有时会有写文件异常 #28

Open
YunfengBo opened this issue Dec 3, 2014 · 1 comment
Open

Comments

@YunfengBo
Copy link

multi_download::stop()方法调用时,有时会有写文件异常,试着改了一下:

--- multi_download.ipp Fri Nov 14 01:34:27 2014
+++ multi_download.ipp.new Wed Dec 3 19:01:08 2014
@@ -606,6 +606,9 @@
ptr->stream->close(ignore);
}
}
+

  • if (m_storage)

  •   m_storage->close();
    

    }

    template
    @@ -894,7 +897,7 @@
    m_download_rate->bytes += bytes_transferred;

    // 保存数据, 当远程服务器断开时, ec为eof, 保证数据全部写入.

  • if (m_storage && bytes_transferred != 0 && (!ec || ec == boost::asio::error::eof))

  • if (m_storage && bytes_transferred != 0 && (!ec || ec == boost::asio::error::eof) && !m_abort)
    {
    // 计算offset.
    boost::int64_t offset = object.request_range.left + object.bytes_transferred;

@Jackarain
Copy link
Member

谢谢报告问题,但没有看明白,补丁格式整理下啊,最好用Push request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants