Skip to content
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

requestContentsOfDirectoryAtFilePath: returns nil and only works after a few minutes #44

Open
flysofast opened this issue Feb 18, 2017 · 0 comments

Comments

@flysofast
Copy link

flysofast commented Feb 18, 2017

Hi,
I've been playing with this project for a while and noticed that (NSArray *)requestContentsOfDirectoryAtFilePath:(NSString *)path error:(NSError **)error worked well most of the time, the only it has a small problem is when the selected share was my computer (the computer that deployed the app, the others on the same LAN work fine), I had to wait for a few minutes before it could return the contents of the root folder (otherwise it would return nil).
This seems to be a little strange, I tried to track down and found out the problem was in this section

- (NSArray *)requestContentsOfDirectoryAtFilePath:(NSString *)path error:(NSError **)error
{
    ...
    //If the path is nil, or '/', we'll be specifically requesting the
    //parent network share names as opposed to the actual file lists

    if (path.length == 0 || [path isEqualToString:@"/"]) {
        smb_share_list list;
        size_t shareCount = 0;
        smb_share_get_list(self.session, &list, &shareCount);
        if (shareCount == 0)
            return nil;
....
     }
}

smb_share_get_list(self.session, &list, &shareCount); was using the same self.session object but returns different results after sometime. It returned 0 at first, then after a while it returned the real contents of the root folder.
I know this question is somewhat related to libdsm but maybe I'm missing something here. Do you see what is wrong here, or have any of you have this issue?
Thank you.

Hardware / Software

I'm using the library with commit 85ff45f (Dec 4, 2016 3:19PM)
iOS 10.3 beta, iPhone 6
macOS 10.12.3, macbook pro 15" late 2013

Expected Results

I want the app to display the contents of my computer's root folder right away when I sign in and access the share.

Actual Results

It's blank at first, then after some time the contents appeared after being reloaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant