Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retro Online Video Player issues in WebOne v0.16 #103

Closed
atauenis opened this issue Sep 8, 2023 · 3 comments
Closed

Retro Online Video Player issues in WebOne v0.16 #103

atauenis opened this issue Sep 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@atauenis
Copy link
Owner

atauenis commented Sep 8, 2023

What's broken

When using recommended settings for video playback under WMP 6.4 (screenshot from wiki is below), it no longer playing videos.
216696802-eadd831a-5f4e-4b1c-824a-7d9a3ba12091
The log says:

frame=    7 fps=0.0 q=6.8 size=       1kB time=00:00:00.24 bitrate=  30.0kbits/s
08.09.2023 12:14:39.214+57633088        <Stream not sent: Unable to write data to the transport connection: Программа на вашем хост-компьютере разорвала установленное подключение..
08.09.2023 12:14:39.214+57634987        <Done (connection close).
08.09.2023 12:14:39.214+78159003         Idle process ffmpeg killed.
08.09.2023 12:14:39.214+78159005         Idle process yt-dlp killed.

This is how in the version from Git repo head. The v0.16-beta3 is displaying a HTTP 500 error message here, meaning the exactly same error, but with lost description message. The message saying that TCP connection with client is lost.

Another bug. Mozilla 0.9 at OS/2 4.52 is crashing when playing Flash video.
OS2 flash crash

Workaround for Windows

  1. Windows Media Player/MSIE:
    • It's still possible to watch videos by setting Microsoft ASF (Stream) video container in selector. However, previously, both formats worked.
  2. Flash:
    • Also Flash-based player is working under IE 5, Netscape 4 at Windows NT 4 (at least).
  3. HTML5:
    • In Windows XP and up, it's possible to use Firefox 3.5+, Chromium browsers with ROVP HTML 5 player. They working.

Workaround for OS/2

None found at current time. May be try other versions of Flash plug-in and/or Web Browser (Mozilla).

Debugging

If set UseMsHttpApi=enable in config file, both errors gone (but together with many new features of v0.16).

Seems that this is caused because at this moment WebOne 0.16's new HTTP processing code (used instead of MS HTTPAPI) does not provide full support for chunked transfer. Converted videos are example of content where full length of file is unknown until end of download. So traditional Content-Length header is not send here, and the client expects other content length info to configure network stack (it can download only content with known length, else memory may overload). HTTP/1.1 specifies chunked transfer (send data by small chunks of fixed length), which is used by most of modern servers, but not implemented in WebOne because of difficulty and lack of free time of main developer. Only old MS HTTPAPI-based server code is properly supporting chunks.

To prevent crash, WMP 6.4 plug-in stops ASF file download if there are no Content Length or Chunk Length specified. And in stream format, it still trying to download and got success here.

OS/2 Flash player, unlike Windows version, is crashing on such video access.

Newer browsers like Firefox 3.x can work with WebOne because they understand HTTP traffic with undefined content length.

So, it's need to implement some kind of chunked transfer encoding support in WebOne by analogy with .NET internal HttpListener architecture. Ideas: https://source.dot.net/#System.Net.HttpListener/System/Net/Managed/HttpResponseStream.Managed.cs,dfc7620c0b548fb5 .

@atauenis atauenis added the bug Something isn't working label Sep 8, 2023
@atauenis
Copy link
Owner Author

Started some attempts to implement chunked transfer in 88b9747, but at this moment it's not very successful.

The code for chunked transfer support can be enabled by uncommenting in WebOne.csproj file these lines:

<PropertyGroup>
	  <DefineConstants>EnableChunkedTransfer</DefineConstants>
</PropertyGroup>

Found that Firefox 3.6 also prefers chunked transfer for video, and don't start video playback until full download if there's simple data flow instead of chunks. Added chunked transfer, and Firefox is now playing video even when it's not fully downloaded.

Great, we're may be glad, but after more deep testing found that situation is not so happy. Other stuffs begins broken. Converted images on Firefox are not downloading/displaying (it rejects file). On old Netscape they are attempted to download, but are broken as chunks are not well decoded.
2023-11-21_14-14-12
(169E\r\n is chunk size of 5790-byte GIF file, and the file became 5803-byte long, with extra garbage)

So needs to fix the bug, and only then the feature can be enabled.

At this moment I'm don't understand why it's not working. Probably need for help.

@atauenis
Copy link
Owner Author

atauenis commented Dec 15, 2023

Continuing to debug chunked transfer. Improved support (will push the commit in few minutes), now Firefox works okay. But Netscape still not. Very strange thing. Same server code, same test file. But with Firefox 3.6 it's working, and with Netscape not. Wireshark dump of both connections is attached. Strange, but Wireshark also don't decodes the response to Netscape. Somewhy. Even however they're identical at first look.
NS304 and FF36 same SVG-PNG.zip

@atauenis
Copy link
Owner Author

I've studied the traffic dumps with more attention, and found that I've incorrectly understood RFCs for HTTP/1.0 and 1.1 (and ways how to debug them via Wireshark).

The HTTP/1.0 have optional support for keep-alive and no support at all for chunked transfer. If length is unknown, simply all should be transferred, then connection close forcely.

The HTTP/1.1 have better keep-alive support (almost obligatorily) and for length-less content chunked transfer is also important. Some browsers like MSIE 5.0 however sending 1.0 requests, really supporting 1.1 protocol fully. But not Windows Media Player 6 (strange, but fact).

So in recent commits I've implemented correct detect of protocol version, and HTTP/1.0 clients are recieving simply data stream, and HTTP/1.1 clients (excluding MSIE6, but it's not a problem) are recieving chunked-encoded data.

OS/2 Flash players are tested with IBM Web Browser and Opera 5, all playing videos w/o problems now.

Upcoming WebOne 0.16.2 will be free from this bug. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant