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

Lee Clagett's review #34

Open
1 of 16 tasks
vinipsmaker opened this issue Jan 15, 2016 · 0 comments
Open
1 of 16 tasks

Lee Clagett's review #34

vinipsmaker opened this issue Jan 15, 2016 · 0 comments

Comments

@vinipsmaker
Copy link
Member

vinipsmaker commented Jan 15, 2016

Specification/type-requirements

  • "async_writeandasync_read_some` in the http::Socket concept requires an entire http::Message concept as an argument, when only the SequenceContainer concept should be necessary for this function" (TODO: decrease requirements and add a few helper functions/types).

  • "It might be worth eventually relaxing the requirements for the key/values in the AssociativeMap used by the field parsing functions to a subset of string functions. begin(), end(), size(), empty(), push_back(), pop_back(), operator<(), a hash implementation, and contigous data. This way a quick and dirty small string optimization could be written for field handling."

  • "The current async_write_response implementation assumes contiguous elements on the SequenceContainer concept, which is incorrect."

    The error on the implementation happens because the implementation converts the body to an asio::buffer. asio::buffer requires contiguous elements. Message concept only requires SequenceContainer.

    A solution could be requiring contiguous elements also within the Message concept.

  • More considerations for design choices (or documentation wording) should be considered - All data reads / writes for the message body require a copy to be made.

  • "How do the various write functions manipulate the headers? What fields are added, if any? This is partially mentioned at the bottom of the http::ServerSocket page, but I saw "content-length: 22" added to my message, and this was never explicitly stated (although obviously assumed). This should likely be explicitly specified in the concept itself, AND the location should be specified (i.e. these fields are explicitly appended). Should also document that some fields, such as content-length cannot be listed twice according to the specification, while comma de-limited fields can be listed multiple times as a valid form of appension. I.e. "content-encoding: gzip, sdch\r\n" and "content-encoding: gzip\r\ncontent-encoding: sdch\r\n" indicate equivalent content encodings applied to the data. Should probably mention that Transfer-Encoding is a comma delimited list too."

  • "The key_type and mapped_type for the headers portion of the message::Concept indicate that they must meet the "String concept". I don't recall seeing this concept being defined in C++ or boost, where does it come from? If its from C++1z, it might be to merge the behavior of string_ref and basic_string, so that concept would be unlikely to require storage like a container. Might want to re-think the concept requirements here, or state that only a conforming std::basic_string implementation is acceptable for now."

pipelining and implicit writes

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

No branches or pull requests

1 participant