[Cronet] UploadDataProviders.create(byte[], offset, count) is broken when offset != 0 |
||||
Issue description[Moving Internal bug: 28116260 to crbug.com] ByteBuffer.wrap(data, offset, length) returns a ByteBuffer with array offset 0 and position offset. ByteBufferUploadDataProvider.rewind resets the position to 0, which is incorrect in this case. The buffer should be sliced before passing it to ByteBufferUploadProvider.
,
May 17 2016
,
May 17 2016
Thanks for identifying the problem and suggesting a fix! CL in review: https://codereview.chromium.org/1983123002/
,
May 17 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e3db5466956f058d7a69c33452a543a15261080d commit e3db5466956f058d7a69c33452a543a15261080d Author: xunjieli <xunjieli@chromium.org> Date: Tue May 17 19:40:11 2016 Fix UploadDataProviders.create(byte[], offset, count) This CL makes UploadDataProviders.create(byte[], offset, count) create a ByteBuffer with position 0, so when rewind() is called, resetting the position back to 0 doesn't break things. BUG= 603124 Review-Url: https://codereview.chromium.org/1983123002 Cr-Commit-Position: refs/heads/master@{#394193} [modify] https://crrev.com/e3db5466956f058d7a69c33452a543a15261080d/components/cronet/android/api/src/org/chromium/net/UploadDataProviders.java [modify] https://crrev.com/e3db5466956f058d7a69c33452a543a15261080d/components/cronet/android/test/javatests/src/org/chromium/net/UploadDataProvidersTest.java
,
May 17 2016
,
May 18 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e18f28140777747260eabb021831c59ee03bc319 commit e18f28140777747260eabb021831c59ee03bc319 Author: xunjieli <xunjieli@chromium.org> Date: Wed May 18 12:43:20 2016 [Cronet] add a test assertion in UploadDataProvidersTest.java This CL adds a test assertion in UploadDataProvidersTest.java to make sure getLength() is correct when UploadDataProvider is constructed with a byte array with an offset. BUG= 603124 Review-Url: https://codereview.chromium.org/1991453002 Cr-Commit-Position: refs/heads/master@{#394392} [modify] https://crrev.com/e18f28140777747260eabb021831c59ee03bc319/components/cronet/android/test/javatests/src/org/chromium/net/UploadDataProvidersTest.java |
||||
►
Sign in to add a comment |
||||
Comment 1 by mef@chromium.org
, Apr 26 2016Labels: FixIt-Net
Status: Available (was: Untriaged)