sseclient
sseclient copied to clipboard
Don't use raw reads for gzipped or chunked encoding (fixes #28, #36)
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.
Alternatively get rid of the short read functionality altogether. Who knows what other issues with it haven't been discovered yet.
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 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.
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 Have you had a chance to work on it so far?
@mutantmonkey ?
@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.