mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 20:45:57 +08:00
完善错误提示
This commit is contained in:
@@ -66,14 +66,7 @@ void HttpDownloader::startDownload(const string& url, const string& filePath,boo
|
||||
int64_t HttpDownloader::onResponseHeader(const string& status,const HttpHeader& headers) {
|
||||
if(status != "200" && status != "206"){
|
||||
//失败
|
||||
shutdown();
|
||||
closeFile();
|
||||
File::delete_file(_filePath.data());
|
||||
if(_onResult){
|
||||
auto errMsg = StrPrinter << "Http Status:" << status << endl;
|
||||
_onResult(Err_other,errMsg,_filePath);
|
||||
_onResult = nullptr;
|
||||
}
|
||||
shutdown(SockException(Err_shutdown,StrPrinter << "Http Status:" << status));
|
||||
}
|
||||
//后续全部是content
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user