-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[URIUtils] Fix IsSmb, IsFTP, IsAfp, IsDAV and IsNfs. #5430
Conversation
jenkins build this please |
@Karlson2k thoughts? I'm a bit unsure if it should go in for helix since it may break some stuff |
It looks like a very nice patch, so I want to approve it. Not sure what the stuff which might break might be though? |
@ace20022 Constructing CURL object for each check is too costly from my point of view. |
Its mostly costly because of our shitty implementation of URL parsing (to support our stupid stupid urls at times :P) Could move the CURL usage to only be called if it actually needs the CURL instance though, afaict now it seems to be created always at the top, which seems a bit unnecessary (perhaps the compiler fixes this though) |
It changes the retun value of some calls... Additionally I'm not aware of any bug report. IIRC I found it while debugging and opening a zip with pictures on a smb share. |
@topfs2 like that? bool URIUtils::IsSmb(const CStdString& strFile)
{
if (IsStack(strFile))
return IsSmb(CStackDirectory::GetFirstStackedFile(strFile));
if (IsSpecial(strFile))
return IsSmb(CSpecialProtocol::TranslatePath(strFile));
CURL url(strFile);
if (HasParentInHostname(url))
return IsSmb(url.GetHostName());
return IsProtocol(strFile, "smb");
}
@Karlson2k |
IMO its our curl that's bad, we shouldn't design around that. So I think Agreed that we can't search for smb in the path, seems very error prone.
|
Sorry, but I can't decipher your comment. Are you okay with this if I change it the way I posted above? |
Haha. Sorry I tend to ramble at times :) I am fine with it. But would love And it might be scary for helix. But it fixed a real issue. Hmm, need to
|
updated... |
@ace20022 As |
But when someone changes the check in |
@topfs2 I think we should postpone this pr. Please change the label if you agree |
ping @Karlson2k okay as is? |
jenkins build this please |
if (IsSpecial(strFile)) | ||
return IsSmb(CSpecialProtocol::TranslatePath(strFile)); | ||
|
||
if (HasParentInHostname(url)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Removing extra URL-decoding is one of the goals for I*. |
mhm, I don't use such a set-up ;) |
@ace20022 Didn't you try to setup a test environment? ;) |
Nah, just found it by accident while testing bdj over smb... |
@MilhouseVH could you include this pr in your test builds? I guess your users have such setups. |
OK |
@ace20022: Needs rebasing on master after the CStdString changes... |
Due to protocol stacking, e.g., files in a zip on a smb share were not recognized as files on a network share.
@MilhouseVH done and thx for the ping. Any reports so far? |
None whatsoever. :) |
@MilhouseVH Any news? If no negative ones I'll hit the button. |
Nothing negative reported - looks like it's safe to hit the button. |
Thanks a lot! |
[URIUtils] Fix IsSmb, IsFTP, IsAfp, IsDAV and IsNfs.
Due to protocol stacking, e.g., files in a zip on a smb share were not recognized as files on a network share.
There might be more is* methods that could benefit from analogue changes.
@Karlson2k for review