Skip to content

add client size close for #712 #713

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

Merged

Conversation

chenzhaoyu
Copy link

@chenzhaoyu chenzhaoyu commented Dec 1, 2016

I attempt to fix #712 , if response body is completed, client side will close connection.

Comments are welcome!

regards,
chenzhaoyu

this->part_begin;
typename protocol_base::buffer_type::const_iterator end = begin;
std::advance(end, remainder);
string_type body_string(begin, end);
Copy link
Member

Choose a reason for hiding this comment

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

Do you even need this copy of the string? Why not use the range instead?

@@ -476,6 +495,50 @@ struct http_async_connection
}
}

inline bool check_parse_body_complete(string_type& body_string)
Copy link
Member

Choose a reason for hiding this comment

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

It looks like you could avoid using strings here, and just deal with ranges of iterators.

@chenzhaoyu chenzhaoyu force-pushed the add-active-client-side-close branch from 4fc7dda to b950ea5 Compare December 1, 2016 08:23
@chenzhaoyu
Copy link
Author

@deanberris , thanks for your comments, I have move body check logic to async_protocol_handler.hpp and no extra body buffer be copied now, please check, thanks~

Copy link
Member

@deanberris deanberris left a comment

Choose a reason for hiding this comment

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

LGTM

@deanberris deanberris merged commit 3183577 into cpp-netlib:master Dec 1, 2016
@chenzhaoyu
Copy link
Author

Hi, @deanberris , can you merge those commits from master into 0.13-release branch?

cnagune added a commit to cnagune/cpp-netlib that referenced this pull request Jul 3, 2017
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.

Add the "Connection: close" header to the request, but Stuck at fetching response body
2 participants