leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
459 stars 21 forks source link

HTTP handler seems not to return EOF / Seamonkey browser specific? #113

Closed ghost closed 3 years ago

ghost commented 3 years ago

This is a follow-up to this issue. I don't know how to re-open the issue, maybe what I am reporting is only a sub-defect:

Feature request support originating HTTP URLs #112 https://\github.com/leaningtech/cheerpj-meta/issues/112

We have now the impression that URLConnection returns indeed a stream, but this stream is not 100% compatible with Java. Especially Content-Length seems possibly

not correctly handled. I am using on the server side Tomcat. My own code reads a text file, until EOF. By a standard loop that uses BufferedReader.readLine(). The loop stops

when BufferedReader.readLine() returns null. Everything seems to work fine with the Java runtime:

image

ghost commented 3 years ago

When I use CheerpJ runtime the test hangs. The progress bar is part of my test application to show that the application is busy. So I see this in the browser:

Unbenannt

In the console I see the expected GET. I tested Seamonkey. Will also test Chrome:

Unbenannt5

The problem could be a thread yield problem, or the problem could be that I am using HTTP 1.1 and not HTTP 1.0. At least the CheerpJ URLConnection has

requested keep alive:

Unbenannt3

And the server has already delivered the text to the client:

Unbenannt4

I am suspecting the EOF is missing. The same problem doesn't happen when I use CheerpJ with /app and the virtual file system. So I guess its not a problem of my client, rather

of the protocol implementation for URLConnection. Should I switch off keep-alive? How do I do this in a compatible way with CheerpJ?

ghost commented 3 years ago

Seems to be a browser problem, i.e. problem with Seamonkey. In Chrome it wurks:

Unbenannt7

Woa! Thats great. But how can I make it work for Seamonkey? Chrome seems to send a little bit more HTTP parameters during GET:

Unbenannt8

ghost commented 3 years ago

Seems to be a very specific Seamonkey problem. For example Firefox, also from Mozilla, works fine:

Unbenannt

marsicplusplus commented 3 years ago

Hi @jburse, CheerpJ is being tested and used on other major browsers like Firefox or Chrome and unfortunately Seamonkey is not one we are planning to target and/or to support.

Because of that we don't know enough about it to be able to help you.

Thanks for your understanding,

Lorenzo