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

onReadDirPlus with small cache yields no results, but no error #111

Open
brandonbloom opened this issue Dec 24, 2023 · 2 comments
Open

onReadDirPlus with small cache yields no results, but no error #111

brandonbloom opened this issue Dec 24, 2023 · 2 comments

Comments

@brandonbloom
Copy link
Contributor

The readme contains this code:

	cacheHelper := nfshelper.NewCachingHandler(handler, 1)

However, this will cause an error like this:

[WARN] Caching handler created with insufficient cache to support directory listing%!(EXTRA string=size, int=1, string=verifiers, int=1)

Ignoring the malformed fmt string, this error makes sense because you need at least two entries for . and .. in a directory. However, if you bump the cache size from 1 to 2, you get empty output for all directories. All other usages of NewCachingHandler appear to specify 1024, and indeed, if you specify that, directory listing works... up to 1024 entries. Pagination still appears broken.

It seems that the started and obj.Cookie handling logic in onReadDirPlus is incorrect, but I haven't fully debugged it yet.

@willscott
Copy link
Owner

this should be better with #118 - it changes the default caching handler to re-use/have more stable handle behavior, which seems needed in many cases.

@willscott
Copy link
Owner

@brandonbloom can you check if the master / head of this repo now has reasonable behavior / does not cause the error you saw previously?

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