Skip to content

Port to Boost 1.87#25

Open
jktjkt wants to merge 1 commit intonghttp2:mainfrom
jktjkt:bug-23
Open

Port to Boost 1.87#25
jktjkt wants to merge 1 commit intonghttp2:mainfrom
jktjkt:bug-23

Conversation

@jktjkt
Copy link

@jktjkt jktjkt commented Sep 11, 2025

This is a fix for #23. I took the patch from microsoft/vcpkg@8eecddf and made it work on older Boost as well (tested on Boost 1.87, 1.82 and 1.78).

Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @jktjkt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on updating the codebase to ensure compatibility with Boost 1.87, while also maintaining support for older Boost versions like 1.78 and 1.82. The changes primarily involve adapting to breaking API changes within Boost.Asio, particularly in network resolution, connection establishment, and I/O context management, to allow the project to build and function correctly with recent Boost releases.

Highlights

  • Boost.Asio API Updates: The pull request updates the usage of Boost.Asio's networking API, specifically for resolver and connection handling, to align with changes introduced in newer Boost versions. This includes adapting async_resolve call signatures and parameter types for connected and start_connect methods.
  • Boost Version Compatibility Layer: A significant change is the introduction of a compatibility layer in asio_http2.h that conditionally aliases Boost.Asio types and functions (like io_service, io_context_work, buffer_cast, and async_connect) based on the BOOST_VERSION to ensure the codebase remains compatible with both older (1.78, 1.82) and newer (1.87) Boost releases.
  • SSL Verification Method Change: The SSL verification callback in asio_client_session_tls_impl.cc has been updated from boost::asio::ssl::rfc2818_verification to boost::asio::ssl::host_name_verification.
  • I/O Context and Work Handling: Changes were made to how io_service::work is managed, transitioning to io_context_work and updating the io_service_.post calls to boost::asio::post to reflect modern Boost.Asio practices.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively ports the project to be compatible with Boost 1.87 by addressing several breaking API changes in Boost.Asio. The changes are well-implemented and consistently applied across the codebase, including updates to resolver logic, SSL verification callbacks, and usage of io_context. The introduction of a compatibility layer in asio_http2.h is a good approach to support multiple Boost versions.

I have one suggestion regarding the Boost version check in the compatibility header to ensure it also works with Boost 1.86, where the API changes were originally introduced.


namespace boost {
namespace asio {
#if BOOST_VERSION >= 108700

Choose a reason for hiding this comment

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

high

The version check BOOST_VERSION >= 108700 seems too specific. The breaking changes in Boost.Asio that this compatibility layer addresses were introduced in Boost 1.86.0 (108600). The vcpkg patch this change is based on also uses 108600. Using 108700 will cause this code to fail with Boost 1.86. To ensure broader compatibility, including with Boost 1.86, please consider changing this to BOOST_VERSION >= 108600.

#if BOOST_VERSION >= 108600

Copy link
Author

Choose a reason for hiding this comment

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

This is just some plausible-sounding crap which is in fact incorrect.

jktjkt added a commit to CESNET/rousette that referenced this pull request Sep 23, 2025
The latest upstream version does not build on Boost 1.87, and there's a
nasty crash in the destructor which led to a nice little heap of hair on
our desks. It's time to fork that thing.

Link: nghttp2/nghttp2-asio#9
Link: nghttp2/nghttp2-asio#25
Change-Id: Iec9619ce45e7e76f0781d39966d0b6c7cc6fa778
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.

3 participants