Skip to content
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

feat: implement client for async-h1 #22

Merged
merged 2 commits into from
Apr 11, 2020
Merged

Conversation

dignifiedquire
Copy link
Member

@dignifiedquire dignifiedquire commented Mar 2, 2020

  • Switches to uses http-types
  • Implement client using async-h1
  • Currently this breaks the isahc client, as isahc::Body is not Sync


client::connect(stream, req).await
}
_ => unreachable!(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should return an error here instead.

Suggested change
_ => unreachable!(),
_ => http_types::bail!("Unsupported protocol prefix"),

@goto-bus-stop
Copy link
Member

isahc 0.9 will make isahc::Body impl Sync 🎉 sagebind/isahc@7c3955f

@yoshuawuyts
Copy link
Member

And it's been merged! sagebind/isahc#172 (comment)

@dignifiedquire
Copy link
Member Author

Unfortunately that was not enough. isahc::Body only implements AsyncRead, whereas http-types::Body requires AsyncBufRead to be implemented.

Thoughts @yoshuawuyts

@dignifiedquire
Copy link
Member Author

Figured it out, using async_std::io::BufReader it now works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants