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

Implement HTTP protocol #469

Merged
merged 17 commits into from
Oct 3, 2022
Merged

Implement HTTP protocol #469

merged 17 commits into from
Oct 3, 2022

Conversation

swlynch99
Copy link
Contributor

This PR introduces a rather simple HTTP protocol. It supports 3 commands - GET, PUT (set), and DELETE which is enough for simple cache use-cases. I have included tests for both request parsing and response emission.

In detail, this PR includes:

  • A HTTP parser that wraps httparse
  • A very simple HTTP response builder that does no validation
  • Tests for the above

Due to limitations around what pelikan allows parsers to do (they can't emit responses) the response parser doesn't directly return a request object but instead returns a wrapper around a Result<Request, Response>. The error response should be sent by the client in the place of creating its own response.

This PR is the first part of breaking apart #468 into mergeable chunks.

Copy link
Contributor

@brayniac brayniac left a comment

Choose a reason for hiding this comment

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

LGTM

@swlynch99 swlynch99 merged commit e8ee626 into twitter:master Oct 3, 2022
@swlynch99 swlynch99 deleted the just-http branch October 3, 2022 21:47
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.

2 participants