Modify

Ticket #4746 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 years ago

Read operations incorrectly accept const_buffers_1

Reported by: chris_kohlhoff Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

In Asio 1.4.6 / Boost 1.44, following program compiles when it shouldn't:

#include <boost/asio.hpp>
#include <string>
#include <vector>

void handler(boost::system::error_code, std::size_t) {}

int main()
{
  boost::asio::io_service io_service;
  boost::asio::ip::tcp::socket sock(io_service);

  boost::asio::const_buffers_1 cb1(0, 0);
  sock.read_some(cb1);
  sock.async_read_some(cb1, handler);

  std::string s;
  sock.read_some(boost::asio::buffer(s));
  sock.async_read_some(boost::asio::buffer(s), handler);

  const std::vector<char> v;
  sock.read_some(boost::asio::buffer(v));
  sock.async_read_some(boost::asio::buffer(v), handler);
}

Attachments

Change History

comment:1 Changed 4 years ago by chris_kohlhoff

  • Summary changed from Read operations incorrectly accept ConstBufferSequences to Read operations incorrectly accept const_buffers_1

comment:2 Changed 4 years ago by chris_kohlhoff

(In [66056]) Fix so that read operations do not accept const_buffers_1 arguments. Refs #4746.

comment:3 Changed 4 years ago by chris_kohlhoff

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [66080].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.