Spinoco / fs2-http

Http Server and client using fs2
MIT License
135 stars 26 forks source link

HttpClient very slow if response has content length #28

Closed guymers closed 6 years ago

guymers commented 6 years ago

If you change spinoco.fs2.http.internal.HttpClientApp to hit http://httpbin.org/html (content length 3741) it will constantly take 60 seconds to complete. Hitting http://httpbin.org/get (content length ~159) returns in the time you would expect. Chunked responses are unaffected.

AdamChlupacek commented 6 years ago

Is that on 0.3 branch? ie fs2 0.10?

AdamChlupacek commented 6 years ago

I did a bit of testing and we actually get all the data we need from the remote server basically immediately, for some reason it seems that stream.take(x) does not terminate the stream properly.

guymers commented 6 years ago

Yes, I was upgrading from 0.2.0-RC1.

Using a local version of fs2 that includes the fix from https://github.com/functional-streams-for-scala/fs2/pull/1090 resolves the problem.

AdamChlupacek commented 6 years ago

@guymers great, so we can close this right?

guymers commented 6 years ago

I just tested with fs2 0.10.2 and its working as expected. Should there be a new version of fs2-http released against that version? Otherwise feel free to close.

AdamChlupacek commented 6 years ago

I dont think we need to release a new version, users can just pop up fs2 in their dependencies, and it will work fine.