-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Handle OC-Total-Length in new chunking #28545
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
Conversation
|
@DeepDiver1975 a few weeks ago I was wondering whether X-OC-Mtime on the final move was considered with new chunking. A local test showed that it was considered. But now in this PR you've added extra code for this. I suspect that the reason it worked was maybe that the final MOVE does a We can't easily move away from 'Sabre\File::put()` due to the part file and hooks logic there. Maybe need some kind of flag ? |
PVince81
left a comment
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.
Looks good in general, some minor problem with mtime touching that happens twice.
See comments.
Integration tests will tell whether chunking still works.
Would be good to add integration tests for X-OC-Total-Size.
| return; | ||
| } | ||
|
|
||
| $mTime = $this->server->httpRequest->getHeader('X-OC-mtime'); |
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.
no more sanitize?
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.
done in Node::touch
| throw new BadRequest('Http header X-OC-Total-Size is missing'); | ||
| } | ||
| $actualSize = $this->sourceNode->getSize(); | ||
| if ($expectedSize != $actualSize) { |
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.
use strict !==
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.
the header is a string and I dont want to cast it to an int due to 32/64 bit nightmare
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.
what does PHP do internally ? whatever PHP does by itself could be even worse ?
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.
if you insist on keeping it, please add a PHP comment to justify this exception for not respecting the coding style
I'll retest this scenario .... THX for the hint |
deb9230 to
04088ca
Compare
04088ca to
1583ab8
Compare
|
aaaaargh ... Jenkins was restarted? 💣 |
|
logic wise the code looks ok to me. I haven't tested it though and I don't know why the test fails |
tests are failing because X-OC-Total-Size is missing in the tests. Is X-OC-Total-Size considered mandatory? |
|
Hold on! I just checked the client source and the header is called EDIT: "Length" and not Lenght, of course |
the server code in the old chunking used OC-Total-Length - are you sure about the twisted chars? |
|
Yes, we re-used the same header on purpose. |
1583ab8 to
095e0e2
Compare
|
jenkins green - please test @SamuAlfageme @ogoffart @guruz |
|
We even have the wrong changelog :-) |
|
@DeepDiver1975 will have a look |
|
@mrow4a To clarify: The wrong size message needs to be displayed, not the "The computed checksum does not match the one received from the client.". (So actually this issue is not sooo important as the client sends a checksum anyway ;-) ) |
|
restarted CI job |
|
Would be good to adjust the integration tests about new chunking too to also send this header |
|
Integration tests to add:
|
095e0e2 to
9e31de0
Compare
|
tested with Chromium Version 60.0.3112.78 |
|
tested with firefox 53.0 (64-bit) |
9e31de0 to
87b4929
Compare
| if (mtime) { | ||
| headers['X-OC-Mtime'] = mtime / 1000; | ||
| } | ||
| if (size) { |
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.
This would exclude the size "0" but then the chunking code isn't triggered for such sizes, so it's ok
PVince81
left a comment
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.
Code changes look fine 👍
|
tested with IE & Safari both are sending "OC-Total-Length" coirrectly |
|
well, and also fixes a critical bug when you upload a file with new chunking in IE11 which results in EPOCH being set as mtime |
|
what about edge? does it work there as well? @phil-davis @individual-it THX |
|
Edge on Win10 laptop with current August "patch Tuesday" patches all applied: oC server on Ubuntu VM PHP dev server running core verify-chunking-total-size branch (this code):
|
|
So this is ready for merge after CI ? @DeepDiver1975 can you prepare the stable10 PR in advance ? Thanks |
yes
done |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Fix short coming of new chunking implementation -
Related Issue
fixes #26988
Motivation and Context
Behave properly ...
How Has This Been Tested?
Tested with the cli tool as shipped in apps/dav/bin
Please test on various browsers
Types of changes
Checklist: