Opened 10 years ago

Closed 9 years ago

#7859 closed Bugs (invalid)

should ssl/engine get_output return const buffer ?

Reported by: itsme@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

compiling the attached testasiossl.cpp program, you get an error message complaining that it is not possible to convert 'mutable_buffers_1' to 'const_buffers_1' in a call to async_write_some, called from write_op. ( see the attached files for the full compiler output )

The reason write_op tries to pass a mutable buffer instead of a const buffer, is that it obtains the buffer by calling 'get_output'. which returns a mutable buffer. ( in boost/asio/ssl/detail/impl/engine.ipp )

shouldn't get_output return a const buffer sequence?

note that in the test program i explicitly defined the types for the buffers, instead of making them a templated argument.

Attachments (4)

testasiossl.cpp (1.6 KB ) - added by itsme@… 10 years ago.
program showing problem with ssl/engine get_output
getoutput-clang-errors.txt (11.8 KB ) - added by itsme@… 10 years ago.
compiler output from clang++
getoutput-gcc-errors.txt (21.0 KB ) - added by itsme@… 10 years ago.
compiler output from g++
asiossl.patch (1.6 KB ) - added by itsme@… 10 years ago.
proposed change to asio/ssl/engine

Download all attachments as: .zip

Change History (5)

by itsme@…, 10 years ago

Attachment: testasiossl.cpp added

program showing problem with ssl/engine get_output

by itsme@…, 10 years ago

Attachment: getoutput-clang-errors.txt added

compiler output from clang++

by itsme@…, 10 years ago

Attachment: getoutput-gcc-errors.txt added

compiler output from g++

by itsme@…, 10 years ago

Attachment: asiossl.patch added

proposed change to asio/ssl/engine

comment:1 by chris_kohlhoff, 9 years ago

Resolution: invalid
Status: newclosed

By explicitly specifying the buffer types your teststream class does not adhere to the stream type requirements. It should accept an arbitrary ConstBufferSequence (for async_write_some) or MutableBufferSequence (for async_read_some).

Note: See TracTickets for help on using tickets.