-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to distinguish HTTP/1 from HTTP/2 conns without Dialyzer errors? #263
Comments
Upon further investigation, just knowing the conn type isn't good enough -- I tested this by making |
The problem is that Dialyzer doesn't let us expose only the What do you think @whatyouhide? |
@ericmj Sorry for the error in my last comment, now corrected. For this reason, a version function alone is not sufficient to pass Dialyzer checks. With the current type opacity, the cheap solution would seem to be a |
The type is defined as Can you check what happens if you make |
Making the Making only |
Do you get a different error when making this change? |
I don't like making the types non-opaque because the fields should not be accessed other than |
@ericmj what if there was a public Mint function we could call to differentiate between HTTP1 and HTTP2? I was thinking something like a |
That sounds like the best solution. Can you send a PR that adds |
I'd be happy to |
Hi folks! I have just added proper handling of
stream_request_body
to Mojito (see PR here), which requires me to distinguish between%Mint.HTTP1{}
and%Mint.HTTP2{}
in my code in order to handle window size updates.This is of course trivial to do in code, however since both
Mint.HTTP1.t()
andMint.HTTP2.t()
types are opaque, I am not sure how to tell the two apart without introducing errors into my Dialyzer output:Any attempt to peek into the struct causes Dialyzer output. Is there a clean way I can tell the two types apart at runtime? Thanks for any help you can provide!
The text was updated successfully, but these errors were encountered: