Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

GeckoWebExecutor implementation#27

Merged
andrenatal merged 5 commits intomozilla:masterfrom
keianhzo:geckoexecutor
Feb 28, 2020
Merged

GeckoWebExecutor implementation#27
andrenatal merged 5 commits intomozilla:masterfrom
keianhzo:geckoexecutor

Conversation

@keianhzo
Copy link
Copy Markdown
Contributor

@andrenatal This implementation adds support for a GeckoWebExecutor based Http connection so projects already using Gecko can simplify the Http stack. The problem is that I get an invalid answer from the server but I cannot debug it so I'm not sure what's happening or why the request is not valid.

@keianhzo keianhzo requested a review from andrenatal February 10, 2020 15:27
Copy link
Copy Markdown
Contributor

@andrenatal andrenatal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to understand why GeckoWebExecutor is not reading the response from the server properly.

@keianhzo
Copy link
Copy Markdown
Contributor Author

@andrenatal I've fixed the issue, made some changes and updated to AndroidX. I think this is ready for review, I've tested it in FxR and it works fine. You can test it in FxR using the v8/mozillaspeech_gbe although I'm still woring on it to remove all the related http stack dependencies.

@keianhzo
Copy link
Copy Markdown
Contributor Author

@andrenatal You should be able to test this in FxR now: MozillaReality/FirefoxReality#2886

// called when response HTTP status is "200 OK"
String json = new String(response);
try {
JSONObject reader = new JSONObject(json);
Copy link
Copy Markdown

@arybin arybin Feb 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that this code is duplicated here and in GeckoNetworking.java consider extracting out into a helper class/or into parent class for parsing JSON into STTResult.

if (webResponse.body != null) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[16384];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants