Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2984 from whaupt/xbmc/ofc/master

[WebServer] Simplify file existence check
  • Loading branch information...
commit ecf024b02489a13f7478b5d58868e38c535f1e3a 2 parents d3a22bb + 1d82f05
Trent Nelson authored
Showing with 3 additions and 12 deletions.
  1. +3 −12 xbmc/network/WebServer.cpp
15 xbmc/network/WebServer.cpp
View
@@ -838,17 +838,7 @@ void CWebServer::SetCredentials(const string &username, const string &password)
bool CWebServer::PrepareDownload(const char *path, CVariant &details, std::string &protocol)
{
- bool exists = false;
- CFile *file = new CFile();
- if (file->Open(path))
- {
- exists = true;
- file->Close();
- }
-
- delete file;
-
- if (exists)
+ if (CFile::Exists(path))
{
protocol = "http";
string url;
@@ -861,9 +851,10 @@ bool CWebServer::PrepareDownload(const char *path, CVariant &details, std::strin
CURL::Encode(strPath);
url += strPath;
details["path"] = url;
+ return true;
}
- return exists;
+ return false;
}
bool CWebServer::Download(const char *path, CVariant &result)
Please sign in to comment.
Something went wrong with that request. Please try again.