GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make http client connection buffer size configurable by umennel · Pull Request #843 · cpp-netlib/cpp-netlib

Conversation

@umennel

@umennel umennel commented May 27, 2018

Copy link
Copy Markdown

I had to find a common header to define the buffer size, so I reused macros.hpp. Also allowed myself to increase buffer size to 4096, like with the server connection.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@umennel
Make http client connection buffer size configurable
90feb46
@umennel umennel mentioned this pull request May 27, 2018
Define http client connection buffer size #842
Closed
deanberris
deanberris reviewed May 28, 2018
View reviewed changes
Comment thread boost/network/protocol/http/client/connection/async_normal.hpp
namespace impl {

template <class Tag>
template <class buffer_type>

@deanberris deanberris May 28, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think this change is necessary... unless I'm missing something.

We're using the Tag type to determine the character type being placed in the array definition. If anything, I suspect you want to lift the trait to determine what the buffer type should be for a given tag.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@umennel umennel May 28, 2018

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

My thought was that I didn't want to redefine the buffer_type in the parser, which is just a helper class. The actual buffer type is defined in the class utilizing the parser, and then just forwarded. IMHO it was redundancy introduced by mistake which enforced redefinition of exactly the same buffer type in a helper class.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@deanberris deanberris May 28, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

True, but not in the way it's designed to use traits to dispatch on the tag. Arguably the problem is that we're hard-coding the type of the buffer instead of using the tag-based dispatch we've been using everywhere. Because this is currently an implementation detail, I think the way you've done it is fine -- but that we might want to think about the wider design of this, so that it can be applied more systematically.

At this point, since the tests pass I'm willing to merge this as-is, but something worth thinking about in the future to clean this up better.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
deanberris
deanberris approved these changes May 28, 2018
View reviewed changes

@deanberris deanberris left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@deanberris
deanberris merged commit 5a1c841 into cpp-netlib:0.13-release May 28, 2018
@umennel

umennel commented May 28, 2018

Copy link
Copy Markdown
Author

Thanks for approving. Maybe you could explain the concept of "using traits to dispatch on the tag" a bit more. I didn't really understand it. It would help to avoid misunderstandings in the future.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@deanberris

deanberris commented May 28, 2018

Copy link
Copy Markdown
Member

No big deal, but I realise that the documentation for this approach has disappeared from the 0.13 docs. I found the description to the approach in the 0.8 docs, which thankfully is still in the website:

http://cpp-netlib.org/0.8/tag_metafunctions.html

This document describes how we can determine metafunctions that will take a tag as a parameter, then provide the appropriate type depending on the tag. This dispatch mechanism is how we allow for all sorts of customisations that are predicated around a single tag type.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@umennel
umennel deleted the client_buffer_size branch May 28, 2018 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@deanberris deanberris deanberris approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@umennel @deanberris
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.