Comments (4)
Actually I can see from the Erlang docs for both ssl
and gen_tcp
, that:
If Length > 0, exactly Length bytes are returned, or an error; possibly discarding less than Length bytes of data when the socket is closed from the other side.
https://www.erlang.org/doc/man/gen_tcp#recv-3
So I guess this is expected behaviour? Although what is the right way to handle an HTTP response without a Content-Length
header? Or one that is shorter than the initial byte_count
?
from mint.
Here's a minimal test case if it's useful: https://gist.github.com/tomtaylor/30780323285967a567eba6b8c2e23576
from mint.
@tomtaylor thanks for the report! No, this is not a bug. It's the expected behavior, and the same as :ssl.recv/3
and :gen_tcp.recv/3
. I updated the docs with more clarification 🙃
from mint.
Thanks for clarifying!
from mint.
Related Issues (20)
- Basic authorization a la Curl HOT 1
- FunctionClauseError when closing a conn in state :handshaking HOT 2
- Mint.HTTP1.Request private fn validate_header_value throws Erlang error: {:bad_generator, nil} when value is nil HOT 1
- Network errors doesn't surface correctly in IPv6-only network HOT 4
- Passive mode HTTP/2 error in Mint v1.5 HOT 9
- Log of read only connection stream gives connection closed messages HOT 3
- Confusing `Mint.HTTP2.open?/2` HOT 4
- Random timeout errors HOT 2
- How can refs help in figuring out which response belongs to which request? HOT 14
- `Mint.HTTP1` leaks socket upon receive timeout HOT 3
- Too many `Mint.TransportError socket closed` HOT 2
- `:ssl_closed` unknown messages on `www.apple.com` HOT 7
- Unexpected Bad Certificate errors HOT 9
- Mint's `downcase_ascii/1` is slower than `String.downcase(str, :ascii)` HOT 5
- Error messaging context HOT 7
- Connection close with TLSv1.3 after updating to Elixir 1.16 and OTP 26 HOT 3
- Warning about function `set_flag/2` being unused HOT 1
- Avoid unnecessary `WINDOW_UPDATE` frames in HTTP/2 client HOT 1
- Avoid unnecessary `RST_STREAM` frames in HTTP/2 implementation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mint.