Uh oh!
There was an error while loading. Please reload this page.
Handle OC-Total-Length in new chunking - #28545
Conversation
PVince81
commented
Aug 1, 2017
@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.
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'); |
| 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.
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.
what does PHP do internally ? whatever PHP does by itself could be even worse ?
There was a problem hiding this comment.
if you insist on keeping it, please add a PHP comment to justify this exception for not respecting the coding style
DeepDiver1975
commented
Aug 1, 2017
I'll retest this scenario .... THX for the hint |
deb9230 to
04088caCompare04088ca to
1583ab8CompareDeepDiver1975
commented
Aug 1, 2017
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 |
DeepDiver1975
commented
Aug 2, 2017
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 |
DeepDiver1975
commented
Aug 2, 2017
the server code in the old chunking used OC-Total-Length - are you sure about the twisted chars? |
ogoffart
commented
Aug 2, 2017
Yes, we re-used the same header on purpose. |
1583ab8 to
095e0e2CompareDeepDiver1975
commented
Aug 2, 2017
jenkins green - please test @SamuAlfageme@ogoffart@guruz |
guruz
commented
Aug 2, 2017
We even have the wrong changelog :-) |
mrow4a
commented
Aug 3, 2017
@DeepDiver1975 will have a look |
guruz
commented
Aug 4, 2017
@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 ;-) ) |
PVince81
commented
Aug 7, 2017
restarted CI job |
PVince81
commented
Aug 8, 2017
Would be good to adjust the integration tests about new chunking too to also send this header |
PVince81
commented
Aug 8, 2017
Integration tests to add:
|
095e0e2 to
9e31de0CompareDeepDiver1975
commented
Aug 10, 2017
tested with Chromium Version 60.0.3112.78 |
DeepDiver1975
commented
Aug 10, 2017
tested with firefox 53.0 (64-bit) |
9e31de0 to
87b4929Compare| if (mtime) { | ||
| headers['X-OC-Mtime'] = mtime / 1000; | ||
| } | ||
| if (size) { |
There was a problem hiding this comment.
This would exclude the size "0" but then the chunking code isn't triggered for such sizes, so it's ok
individual-it
commented
Aug 11, 2017
tested with IE & Safari both are sending "OC-Total-Length" coirrectly |
PVince81
commented
Aug 11, 2017
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 |
DeepDiver1975
commented
Aug 11, 2017
what about edge? does it work there as well? @phil-davis@individual-it THX |
phil-davis
commented
Aug 11, 2017
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):
|
PVince81
commented
Aug 11, 2017
So this is ready for merge after CI ? @DeepDiver1975 can you prepare the stable10 PR in advance ? Thanks |
DeepDiver1975
commented
Aug 11, 2017
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: