Skip to content

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

Open
@brandonbloom

Description

@brandonbloom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions