Skip to content

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

Description

@YunfengBo

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions