Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 13, 2025

Summary

Fixed incorrect terminology in the serializer.hpp documentation. The javadocs were using "reading" terminology when they should use "writing" to correctly describe the serializer's purpose.

Background

The serializer is used to write HTTP messages to remote peers (e.g., with asio::write), while the parser is used to read from remote peers (e.g., with asio::read). The documentation should consistently reflect this perspective.

Changes

Updated the start_stream() method documentation in three places:

  1. Main description (line 340-341): Changed from "for reading the body from an external source" to "for writing the body to an external destination"

  2. Control flow description (line 349): Changed from "while reading from an external source" to "for writing to the remote peer"

  3. Return value description (line 400): Changed from "for reading body content into" to "for writing body content into"

Example

The corrected documentation now properly describes the serializer's role:

// Returns a stream object for WRITING the body to an external destination
serializer::stream strm = serializer.start_stream(response);

This aligns with typical usage where the serializer is used with write operations:

write_some(client, serializer);  // Writing to the remote peer

Fixes issue where the javadocs incorrectly suggested the serializer was for reading data instead of writing it.

Original prompt

This section details on the original issue you should resolve

<issue_title>docs: serializer javadocs are backwards</issue_title>
<issue_description>For example here:
https://github.com/cppalliance/http_proto/blob/develop/include/boost/http_proto/serializer.hpp#L340

        Initializes the serializer with the HTTP
        start-line and headers from `m`, and returns
        a @ref stream object for reading the body
        from an external source.

This should say "writing the body" because we always word things from the perspective of the remote peer. That is, we write the body (to the remote peer). We read the body (from the remote peer). Serializer is used with asio::write for example. We don't use asio::read, as that is for parser.</issue_description>

<agent_instructions>Do not change anything except comments in the file "include/boost/http_proto/serializer.hpp"</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #176


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: vinniefalco <1503976+vinniefalco@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Fix serializer Javadocs to correct perspective on body docs: fix serializer javadocs to use 'writing' instead of 'reading' Oct 13, 2025
@Copilot Copilot AI requested a review from vinniefalco October 13, 2025 00:45
Copilot finished work on behalf of vinniefalco October 13, 2025 00:45
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.48%. Comparing base (1a8a81c) to head (ef5a587).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #177   +/-   ##
========================================
  Coverage    92.48%   92.48%           
========================================
  Files           71       71           
  Lines         4854     4854           
========================================
  Hits          4489     4489           
  Misses         365      365           
Files with missing lines Coverage Δ
include/boost/http_proto/serializer.hpp 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a8a81c...ef5a587. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

docs: serializer javadocs are backwards

2 participants