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

Return Server& from handler setters #836

Merged
merged 4 commits into from Jan 22, 2021
Merged

Return Server& from handler setters #836

merged 4 commits into from Jan 22, 2021

Conversation

ghost
Copy link

@ghost ghost commented Jan 22, 2021

Server instance methods, set_error_handler, set_pre_routing_handler, and set_post_routing_handler all returned void.
This updates them to return Server&, allowing chaining between them.

Is there anything else that might also make sense to chain?

I think set_expect_100_continue_handler, set_logger, set_file_request_handler, and others should do the same.
Suggestions?

@ghost ghost marked this pull request as ready for review January 22, 2021 01:15
@yhirose
Copy link
Owner

yhirose commented Jan 22, 2021

@00ff0000red, thanks for the pull request. There is no problem to do the same with set_expect_100_continue_handler, set_logger, set_file_request_handler.

@ghost
Copy link
Author

ghost commented Jan 22, 2021

If I understood that corectly, you're okay with me adding a few more; on it!

Do you think that the same should be done for other classes, like Client?

@yhirose yhirose merged commit 13184f5 into yhirose:master Jan 22, 2021
@yhirose
Copy link
Owner

yhirose commented Jan 22, 2021

@00ff0000red, thanks for your fine contribution!

@ghost ghost deleted the patch-1 branch January 22, 2021 15:32
ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
* Update httplib.h

* Update httplib.h

* Update httplib.h

* Update httplib.h
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.

1 participant