GeckoWebExecutor sometimes sends empty request bodies
Categories
(GeckoView :: General, defect, P1)
Tracking
(firefox66 wontfix, firefox67 wontfix, firefox68 fixed)
People
(Reporter: sebastian, Assigned: snorp)
Details
(Whiteboard: [geckoview:fenix:m4])
Attachments
(1 file)
AC issue: https://github.com/mozilla-mobile/android-components/issues/2715
See comments in AC issue.
Some quotes:
Working with @vladikoff and @thomcc, we can now reproduce this consistently. We have some POST requests getting sent without a body although the InputStream was correctly passed from A-S to A-C, then read into a ByteBuffer and passed to GWE.
GWE also sets the content-length header correctly based on the size of the ByteBuffer, but then fails to read, and sends an empty request body. After debugging this for a while, one suspicion is the potential offset of the backing array in ByteBuffer. In the non-working case, we always see an offset, meaning that just consuming e.g. from buffer.array() (without taking the offset into account) wouldn't work as the first byte(s) will be 0.
Since GWE requires a direct ByteBuffer (created with ByteBuffer.allocateDirect), A-C doesn't seem to be able to control this offset and it would have to be taken into account on the consuming-side (in GWE)...unless GWE is just using JNI's GetDirectBufferAddress which should just work.
Reporter | ||
Comment 1•5 years ago
|
||
Copying question from the AC issue here and setting needinfo for snorp :)
@snorp We need your help here :). Did you encounter this before (failing for some but not all streams)? Anything we're doing wrong there when creating the ByteBuffer: https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-gecko-nightly/src/main/java/mozilla/components/browser/engine/gecko/fetch/GeckoViewFetchClient.kt#L97
Assignee | ||
Comment 2•5 years ago
|
||
I replied on github, but I do think we have some sort of bug here. I'll investigate today.
Assignee | ||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
James says this bug is blocking Fenix Sync.
Assignee | ||
Comment 4•5 years ago
|
||
Pushed by jwillcox@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/729b68c38f9f Correctly copy request bodies in GeckoWebExecutor r=geckoview-reviewers,agi
Comment 6•5 years ago
|
||
bugherder |
Description
•