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

fix build with boost 1.87.0 #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions src/rmq/rmqio/rmqio_asioconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,16 @@ bool AsioConnection<SocketType>::doRead(bsl::size_t bytes_transferred)
bsl::size_t bytes_decoded = 0;
boost::asio::streambuf::const_buffers_type bufs = d_inbound->data();
bsl::vector<rmqamqpt::Frame> readFrames;
for (boost::asio::streambuf::const_buffers_type::const_iterator i =
bufs.begin();
i != bufs.end();
++i) {
boost::asio::const_buffer buf(*i);
Decoder::ReturnCode rcode =
d_frameDecoder->appendBytes(&readFrames, buf.data(), buf.size());
if (rcode != Decoder::OK) {
BALL_LOG_WARN << "Bad rcode from decoder: " << rcode;
// Fail but we still want to process frames we were able to decode
success = false;
break;
};
bytes_decoded += buf.size();
}

boost::asio::const_buffer buf(bufs);
Decoder::ReturnCode rcode =
d_frameDecoder->appendBytes(&readFrames, buf.data(), buf.size());
if (rcode != Decoder::OK) {
BALL_LOG_WARN << "Bad rcode from decoder: " << rcode;
// Fail but we still want to process frames we were able to decode
success = false;
};
bytes_decoded += buf.size();

if (bytes_decoded != bytes_transferred) {
BALL_LOG_WARN << "bytes_decoded (" << bytes_decoded
Expand Down
4 changes: 2 additions & 2 deletions src/rmq/rmqio/rmqio_asioeventloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ void AsioEventLoop::onThreadStarted()
d_condition.broadcast();
}

void AsioEventLoop::postImpl(const Item& item) { d_context.post(item); }
void AsioEventLoop::dispatchImpl(const Item& item) { d_context.dispatch(item); }
void AsioEventLoop::postImpl(const Item& item) { boost::asio::post(d_context, item); }
void AsioEventLoop::dispatchImpl(const Item& item) { boost::asio::dispatch(d_context, item); }

bsl::shared_ptr<rmqio::Resolver>
AsioEventLoop::resolver(bool shuffleConnectionEndpoints)
Expand Down
10 changes: 6 additions & 4 deletions src/tests/rmqamqp/rmqamqp_connection.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class MockConnection : public rmqio::Connection {

BSLS_ASSERT_OPT(rc == Frame::OK);

d_eventLoop.post(
boost::asio::post(
d_eventLoop,
bdlf::BindUtil::bind(d_connectionCallbacks.onRead, decoded));
}
}
Expand All @@ -156,7 +157,8 @@ class MockConnection : public rmqio::Connection {
{
BALL_LOG_TRACE << "MockConnection close";

d_eventLoop.post(bdlf::BindUtil::bind(cb, GRACEFUL_DISCONNECT));
boost::asio::post(d_eventLoop,
bdlf::BindUtil::bind(cb, GRACEFUL_DISCONNECT));
}

void asyncWriteImpl(
Expand All @@ -175,7 +177,7 @@ class MockConnection : public rmqio::Connection {
rmqamqpt::Method(
rmqamqpt::ConnectionMethod(rmqamqpt::ConnectionCloseOk())));

d_eventLoop.post(callback);
boost::asio::post(d_eventLoop, callback);

if (!closeOk) {
feedNextFrame();
Expand Down Expand Up @@ -301,7 +303,7 @@ ACTION_P3(ConnectMockConnection, mockConnectPtrPtr, replayFrame, eventLoop)

ON_CALL(**mockConnectPtrPtr, isConnected()).WillByDefault(Return(true));

eventLoop.get().post(arg4);
boost::asio::post(eventLoop.get(), arg4);

return *mockConnectPtrPtr;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tests/rmqio/rmqio_asioresolver.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ TEST_F(ResolverTests, ShufflesResolverResults)
for (int i = 0; i < 5; i++) {
bsl::string ip = bsl::to_string(i) + ".0.0.0";
entry_type::endpoint_type endpoint(
boost::asio::ip::address::from_string(std::string(ip)), 1);
boost::asio::ip::make_address(std::string(ip)), 1);
entries.push_back(entry_type(endpoint, host, port));
}
AsioResolver::results_type resolverResults =
Expand Down Expand Up @@ -140,7 +140,7 @@ TEST_F(ResolverTests, NoShuffleDoesNotReorderResolverResults)
for (int i = 0; i < 5; i++) {
bsl::string ip = bsl::to_string(i) + ".0.0.0";
entry_type::endpoint_type endpoint(
boost::asio::ip::address::from_string(std::string(ip)), 1);
boost::asio::ip::make_address(std::string(ip)), 1);
entries.push_back(entry_type(endpoint, host, port));
}
AsioResolver::results_type resolverResults =
Expand Down