-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add Scandata to upload session #4657
Conversation
Signed-off-by: jkoberg <jkoberg@owncloud.com>
9aeec86
to
b9d7022
Compare
@@ -298,7 +298,8 @@ func (s *OcisSession) MTime() time.Time { | |||
|
|||
// IsProcessing returns true if all bytes have been received. The session then has entered postprocessing state. | |||
func (s *OcisSession) IsProcessing() bool { | |||
return s.info.Size == s.info.Offset | |||
// We might need a more sophisticated way to determine processing status soon | |||
return s.info.Size == s.info.Offset && s.info.MetaData["scanResult"] == "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when bytes are ready this will also return true because the scanResult has not been written yet. We should populate it when all bytes have been received. Maybe with "processing"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when bytes are ready this will also return true because the scanResult has not been written yet.
This is what it is supposed to do. It should only return false when a virus was detected. But you are right, there is small time gap in which either
- virusscan data was written but postprocessing is not yet finished
- postprocessing is finished but virusscan data is not yet written
I'd consider that "eventual consistent", as this time frame should be very small.
Maybe with "processing"
I don't see how this would change the outcome? Instead of checking for ""
we would check for "processing"
. Nothing else changes.
In general I would consider an item "processing"
from the moment all bytes are received until either the upload session gets the deleted (success case) or a virus occurs (error case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, I had the logic flipped in my head.
Adds virus scan data to upload sessions