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

A mechanism to ensure that the parser will only parse requests or only parse responses #11

Open
bvanderveen opened this issue Mar 29, 2014 · 0 comments

Comments

@bvanderveen
Copy link
Owner

As described by @sergey-litvinov on #10:

  • update IHttpParserDelegate just to have common methods between request and response (Headers, Body, etc).
  • create two interfaces IHttpRequestParserDelegate and IHttpResponseParserDelegate that will inherit IHttpParserDelegate with Request\Response specific methods.
  • two constructors for HttpParser.
    • one receives IHttpRequestParserDelegate.
    • one receives IHttpResponseParserDelegate.
  • two member variables
    • one IHttpParserDelegate variable
    • a flag as to whether the delegate is a IHttpRequestParserDelegate or a IHttpResponseParserDelegate
  • in the request/response-specific embedded actions, check the flag on and throw and exception if the value is unexpected
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

No branches or pull requests

1 participant