Cronet HttpURLConnection implementation uploads more data than what is written. |
||
Issue descriptionWhen fixed mode streaming is enabled, Cronet HttpURLConnection implementation sometimes sends more data than what is written to the OutputStream. This will trigger an exception with the following stack trace: 06-09 19:30:20.353 I/TestRunner( 2582): Caused by: org.chromium.net.UrlRequestException: Exception received from UploadDataProvider 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetUrlRequest.onUploadException(CronetUrlRequest.java:452) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetUploadDataStream.onError(CronetUploadDataStream.java:178) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetUploadDataStream.access$600(CronetUploadDataStream.java:31) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetUploadDataStream$1.run(CronetUploadDataStream.java:58) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.urlconnection.MessageLoop.loop(MessageLoop.java:110) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.urlconnection.MessageLoop.loop(MessageLoop.java:83) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.urlconnection.CronetFixedModeOutputStream.write(CronetFixedModeOutputStream.java:99) 06-09 19:30:20.353 I/TestRunner( 2582): at java.io.OutputStream.write(OutputStream.java:82) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.QuicUploadTest.testOneMassiveWrite(QuicUploadTest.java:67) 06-09 19:30:20.353 I/TestRunner( 2582): at java.lang.reflect.Method.invokeNative(Native Method) 06-09 19:30:20.353 I/TestRunner( 2582): at java.lang.reflect.Method.invoke(Method.java:515) 06-09 19:30:20.353 I/TestRunner( 2582): at junit.framework.TestCase.runTest(TestCase.java:168) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:137) 06-09 19:30:20.353 I/TestRunner( 2582): ... 9 more 06-09 19:30:20.353 I/TestRunner( 2582): Caused by: java.lang.IllegalArgumentException: Read upload data length 196608 exceeds expected length 195055 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetUploadDataStream.onReadSucceeded(CronetUploadDataStream.java:193) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.urlconnection.CronetFixedModeOutputStream$UploadDataProviderImpl.read(CronetFixedModeOutputStream.java:162) 06-09 19:30:20.353 I/TestRunner( 2582): at org.chromium.net.CronetUploadDataStream$1.run(CronetUploadDataStream.java:56) 06-09 19:30:20.353 I/TestRunner( 2582): ... 18 more
,
Jun 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a5c5c291f250fc26e4eb6322edb776800c974e7f commit a5c5c291f250fc26e4eb6322edb776800c974e7f Author: xunjieli <xunjieli@chromium.org> Date: Tue Jun 14 15:02:44 2016 [Cronet] Fix CronetFixedModeOutputStream to not write more bytes than specified This CL fixes CronetFixedModeOutputStream to not send more data than what has been written by consumer. Before this patch, the code was trying to write the whole mBuffer even if it is partially filled. This results in more data being written to the CronetUploadDataStream. This CL adds a test which will fail without this patch with an error message that complains writing more bytes than content-length. BUG= 618872 Review-Url: https://codereview.chromium.org/2055083002 Cr-Commit-Position: refs/heads/master@{#399706} [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/BUILD.gn [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/api/src/org/chromium/net/CronetEngine.java [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetFixedModeOutputStreamTest.java [add] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/QuicUploadTest.java
,
Jun 14 2016
,
Jun 15 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a5c5c291f250fc26e4eb6322edb776800c974e7f commit a5c5c291f250fc26e4eb6322edb776800c974e7f Author: xunjieli <xunjieli@chromium.org> Date: Tue Jun 14 15:02:44 2016 [Cronet] Fix CronetFixedModeOutputStream to not write more bytes than specified This CL fixes CronetFixedModeOutputStream to not send more data than what has been written by consumer. Before this patch, the code was trying to write the whole mBuffer even if it is partially filled. This results in more data being written to the CronetUploadDataStream. This CL adds a test which will fail without this patch with an error message that complains writing more bytes than content-length. BUG= 618872 Review-Url: https://codereview.chromium.org/2055083002 Cr-Commit-Position: refs/heads/master@{#399706} [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/BUILD.gn [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/api/src/org/chromium/net/CronetEngine.java [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java [modify] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetFixedModeOutputStreamTest.java [add] https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/QuicUploadTest.java
,
Jul 11 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bf9178a723b6fb899d7b73f2793d532fc4badd66 commit bf9178a723b6fb899d7b73f2793d532fc4badd66 Author: xunjieli <xunjieli@chromium.org> Date: Mon Jul 11 15:53:30 2016 [Cronet] Remove buffer.compact from CronetChunkedOutputStream This CL unifies the buffer manipulation code in CronetChunkedOutputStream to match the one in CronetFixedOutputStream. BUG= 626653 BUG= 618872 Review-Url: https://codereview.chromium.org/2133273002 Cr-Commit-Position: refs/heads/master@{#404664} [modify] https://crrev.com/bf9178a723b6fb899d7b73f2793d532fc4badd66/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetChunkedOutputStream.java [modify] https://crrev.com/bf9178a723b6fb899d7b73f2793d532fc4badd66/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java |
||
►
Sign in to add a comment |
||
Comment 1 by sidv@chromium.org
, Jun 13 2016