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

watch() filter inconsistent behaviour #352

Open
ccudmore opened this issue Nov 14, 2023 · 1 comment
Open

watch() filter inconsistent behaviour #352

ccudmore opened this issue Nov 14, 2023 · 1 comment

Comments

@ccudmore
Copy link

With the following code:

      SmbWatchHandle watcher = root.watch(FileNotifyInformation.FILE_ACTION_ADDED, true);
      for (;;) {
        List<FileNotifyInformation> changes = watcher.watch();
        for (FileNotifyInformation i : changes) {
          System.out.println(i.getAction() + ":"+i.getFileName());
        }
      }

File add and delete actions are both returned by the filter. Adding a file and deleting it results in:
1:Test.txt
2:Test.txt

@mbechler
Copy link
Contributor

mbechler commented Dec 3, 2023

The filter should be directly passed to the SMB server. I don't see how that would fail in the library, but you could easily verify this by checking the CHANGE_NOTIFY request with e.g. Wireshark. Everything else is reponsibility of the server, unless something goes wrong with decoding the response, this looks like a server bug to me. You certainly could add filtering on your side, but I'm not sure I want to add that to the library.

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

2 participants