Don't set parent's "don't cache" to match child - #886
Conversation
Don't set the parent layer's "don't cache" flag to match the child. `emax_reached()` already does the same thing so doing it again is unnecessary. Signed-off-by: Craig Andrews <candrews@integralblue.com>
|
Ah I see you feel the same as I felt when writing the comment:
Yeah I think it should be safe to merge your PR. It's a very minor optimization and shouldn't change the behavior at all. Right? |
It increases cacheability which can be a major optimization :-)
Yes, correct. |
It shouldn't and it is critical that we do not increase cacheability here. We do basically the same process but in one fell swoop whenever we exceed the limits. Right here we set that flag for all parent layers: The reason is that if any portion of the file could not not be scanned because of these limits, it does not mean it is clean. Scanning it later (perhaps at a lower recursion depth or in a smaller file) may result in actually scanning that portion and finding malware. |
|
You are, of course, correct, and I was mistaken. I got this PR confused with another effort - I apologize for the mistake. This PR is, as you said, a very minor optimization and shouldn't change the behavior at all, and I believe it is safe to merge. |
val-ms
left a comment
There was a problem hiding this comment.
I did a little bit more testing and confirmed I'm very comfortable merging this PR.
Don't set the parent layer's "don't cache" flag to match the child.
emax_reached()already does the same thing so doing it again is unnecessary.See db013a2 to see when the code that this commit removes was added.