sta / sta/websocket-sharp

HttpConnection - deadlock?

Open
#279 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hi,

ive got some problems with downloading multiple files on slow connection. For example my index.html got in debug 100 files(css and js) and in release 4 files(css and js), some files are over 2mb, even compressed. All browsers now are downloading in parallel files, so for example chrome (when my app is in release mode) is trying to download 3 files in parallel, all are over 2mb. On slow connection it takes some time to download 2mb (almoust always over 15 sec, on 3G with VPN).
The problem is that browser is getting only like 40kb and than it hangs doing nothing.
After 15k ms(your timeout) the "onTimeout" is rised and the connection is closed. So those 3 files get ERR_CONTENT_LENGTH_MISMATCH. Also it doesnt matter if im sending chunked or not.
Maybe lock should be on smaller parts of code and timout should be on every chunk instead of whole response?
Oh and the problem also in mainly on Linux, Windows is working better, but also sometimes it has such error.

Regards,
Piotr Jarocki

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HttpConnection's response handling and the 15-second timeout/onTimeout path described in the report. Reproduce parallel downloads on a slow Linux connection, then determine whether timeout behavior is incorrectly applied while chunks are still arriving; done means large concurrent downloads complete without ERR_CONTENT_LENGTH_MISMATCH.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.