aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasyl Gello <vasek.gello@gmail.com>2024-09-17 14:32:02 +0000
committerGitHub <noreply@github.com>2024-09-17 14:32:02 +0000
commit8d82d21da44b17c918378cc3ad941a46807bb330 (patch)
treeebdb672de36d64b840228d36739c8f4b6e31434f
parent0d165bea7389e42857a1b87110ed661bb9fbf33b (diff)
parentbba351556f5323fbd97057c8014c18d098f5e037 (diff)
Merge pull request #25638 from basilgello/local-addon-repo
-rw-r--r--xbmc/URL.cpp5
-rw-r--r--xbmc/filesystem/CurlFile.cpp10
2 files changed, 13 insertions, 2 deletions
diff --git a/xbmc/URL.cpp b/xbmc/URL.cpp
index 3102a4d69f..8bc0f98c7f 100644
--- a/xbmc/URL.cpp
+++ b/xbmc/URL.cpp
@@ -131,13 +131,16 @@ void CURL::Parse(std::string strURL1)
// ones that come to mind are iso9660, cdda, musicdb, etc.
// they are all local protocols and have no server part, port number, special options, etc.
// this removes the need for special handling below.
+ // clang-format off
if (
IsProtocol("stack") ||
IsProtocol("virtualpath") ||
IsProtocol("multipath") ||
IsProtocol("special") ||
- IsProtocol("resource")
+ IsProtocol("resource") ||
+ IsProtocol("file")
)
+ // clang-format on
{
SetFileName(std::move(strURL).substr(iPos));
return;
diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp
index 0269dbfc48..58215701b1 100644
--- a/xbmc/filesystem/CurlFile.cpp
+++ b/xbmc/filesystem/CurlFile.cpp
@@ -1097,7 +1097,15 @@ bool CCurlFile::Open(const CURL& url)
m_httpresponse = m_state->Connect(m_bufferSize);
- if (m_httpresponse <= 0 || (m_failOnError && m_httpresponse >= 400))
+ long hte = 0;
+
+ // Allow HTTP response code 0 for file:// protocol
+ if (url2.IsProtocol("file"))
+ {
+ hte = -1;
+ }
+
+ if (m_httpresponse <= hte || (m_failOnError && m_httpresponse >= 400))
{
std::string error;
if (m_httpresponse >= 400 && CServiceBroker::GetLogging().CanLogComponent(LOGCURL))