Skip to content

Commit

Permalink
Don't add connection-timeout for special:// paths if remote path
Browse files Browse the repository at this point in the history
  • Loading branch information
phunkyfish committed Oct 7, 2024
1 parent 08604fb commit 92bd4e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/iptvsimple/utilities/WebUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ bool WebUtils::IsNfsUrl(const std::string& url)
return StringUtils::StartsWith(url, NFS_PREFIX);
}

bool WebUtils::IsSpecialUrl(const std::string& url)
{
return StringUtils::StartsWith(url, SPECIAL_PREFIX);
}

std::string WebUtils::RedactUrl(const std::string& url)
{
std::string redactedUrl = url;
Expand Down Expand Up @@ -150,7 +155,7 @@ bool WebUtils::Check(const std::string& strURL, int connectionTimeoutSecs, bool
return false;
}

if (!IsNfsUrl(strURL))
if (!IsNfsUrl(strURL) && !IsSpecialUrl(strURL))
fileHandle.CURLAddOption(ADDON_CURL_OPTION_PROTOCOL, "connection-timeout", std::to_string(connectionTimeoutSecs));

if (!fileHandle.CURLOpen(ADDON_READ_NO_CACHE))
Expand Down
2 changes: 2 additions & 0 deletions src/iptvsimple/utilities/WebUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace iptvsimple
static const std::string HTTP_PREFIX = "http://";
static const std::string HTTPS_PREFIX = "https://";
static const std::string NFS_PREFIX = "nfs://";
static const std::string SPECIAL_PREFIX = "special://";
static const std::string UDP_MULTICAST_PREFIX = "udp://@";
static const std::string RTP_MULTICAST_PREFIX = "rtp://@";

Expand All @@ -28,6 +29,7 @@ namespace iptvsimple
static std::string ReadFileContentsStartOnly(const std::string& url, int* httpCode);
static bool IsHttpUrl(const std::string& url);
static bool IsNfsUrl(const std::string& url);
static bool IsSpecialUrl(const std::string& url);
static std::string RedactUrl(const std::string& url);
static bool Check(const std::string& url, int connectionTimeoutSecs, bool isLocalPath = false);
};
Expand Down

0 comments on commit 92bd4e8

Please sign in to comment.