sseclient icon indicating copy to clipboard operation
sseclient copied to clipboard

Don't use raw reads for gzipped or chunked encoding (fixes #28, #36)

Open Count-Count opened this issue 5 years ago • 7 comments

See issues no. #28, #36. The short read functionality breaks, because it accesses the raw stream directly. This patch disables it if gzipped or chunked encoding is used.

Count-Count avatar Dec 15 '19 11:12 Count-Count

Alternatively get rid of the short read functionality altogether. Who knows what other issues with it haven't been discovered yet.

Count-Count avatar Dec 15 '19 11:12 Count-Count

Alternatively get rid of the short read functionality altogether. Who knows what other issues with it haven't been discovered yet.

That sounds like a problem that should be solved by writing socket-level test cases that can cover chunked and gzipped encodings, as well as a test case to ensure that all messages are processed in a timely manner.

In any case, if the functionality is removed, #8 and #9 will need to be reopened. In the interim, if no one is able to write test cases, perhaps an argument would be a better option?

mutantmonkey avatar Dec 18 '19 00:12 mutantmonkey

@mutantmonkey do you see any issues with this change as written? Or do you have a competing fix waiting in the wings as mentioned at https://github.com/btubbs/sseclient/issues/36?

I don't have a strong preference either way, but want to avoid letting the issue lurk for longer than necessary.

btubbs avatar Feb 27 '20 03:02 btubbs

I have a fix that I believe will work waiting at https://github.com/mutantmonkey/sseclient/tree/use_urllib3_decode, but I haven't had a chance to set up a SSE server that uses chunked encoding to confirm that it will work.

mutantmonkey avatar Feb 27 '20 05:02 mutantmonkey

@mutantmonkey Have you had a chance to work on it so far?

TheSandDoctor avatar Mar 23 '20 01:03 TheSandDoctor

@mutantmonkey ?

TheSandDoctor avatar Jun 26 '20 01:06 TheSandDoctor

@TheSandDoctor I have not; the situation is unchanged right now. I have a fix that I believe will work but I need way to reproduce the issue to confirm this. Right now, I do not have a server configured in this way, but if someone is able to provide a URL to an SSE endpoint that exhibits the issue, I can run a quick test.

mutantmonkey avatar Jul 05 '20 23:07 mutantmonkey