Skip to content

Commit

Permalink
improve wait_for_complete
Browse files Browse the repository at this point in the history
Signed-off-by: Jack <[email protected]>
  • Loading branch information
Jackarain committed Sep 12, 2013
1 parent 88ce27d commit dc88c4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/avhttp/impl/multi_download.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ bool multi_download::wait_for_complete()
}
}
// 检查是否下载完成, 完成返回true, 否则返回false.
boost::int64_t fs = file_size();
boost::int64_t fs = m_file_size;
if (fs != -1)
{
if (fs != bytes_download())
Expand Down Expand Up @@ -758,8 +758,11 @@ std::string multi_download::meta_name(const std::string& url) const

std::string multi_download::file_name() const
{
// 如果文件名为空, 则生成默认文件名.
if (m_file_name.empty())
{
// 构造默认文件名. 如果url中的文件名为空, 那么就默认为index.html, 否则
// 使用url中指定的文件名, 除非settings指定了保存文件路径及文件名.
m_file_name = fs::path(detail::utf8_ansi(m_final_url.path())).leaf().string();
if (m_file_name == "/" || m_file_name == "")
m_file_name = fs::path(m_final_url.query()).leaf().string();
Expand Down

0 comments on commit dc88c4c

Please sign in to comment.