Skip to content

Commit

Permalink
Fix CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay1412 committed Apr 6, 2022
1 parent e25884a commit 2ecc6f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
12 changes: 9 additions & 3 deletions libamqpprox/amqpprox_closeerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ namespace amqpprox {
* \brief Custom exception class
*
* This class will be used to throw custom exception, whenever we get the
* connection Close method from server. Using this exception, we are going to
* pass connection Close method to the exception handler. The exception handler
* eventually can send the Close method to clients for better error handling.
* unexpected connection Close method from server during handshake. Using this
* exception, we are going to pass connection Close method to the exception
* handler. The exception handler eventually can send the Close method to
* clients for better error handling.
*/
class CloseError : public std::runtime_error {
methods::Close d_closeMethod;

public:
// CREATORS
CloseError(const std::string &msg, methods::Close &closeMethod);

// ACCESSORS
/**
* \return connection Close method
*/
methods::Close closeMethod() const;
};

Expand Down
2 changes: 1 addition & 1 deletion libamqpprox/amqpprox_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void Connector::receive(const Method &method, FlowType direction)
} break;
// Acting as a client
case State::STARTOK_SENT: {
decodeMethod(&d_receivedTune, method, methodPayload);
decodeMethod(&d_receivedTune, method, methodPayload, direction);
LOG_TRACE << "Server Tune: " << d_receivedTune;

sendResponse(d_tuneOk, false);
Expand Down
4 changes: 3 additions & 1 deletion libamqpprox/amqpprox_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ void Session::handleData(FlowType direction)
sendSyntheticData();

std::ostringstream oss;
oss << error.what() << ", Received method: " << receivedClose;
oss << error.what()
<< ", Received method from server: " << receivedClose;
logException(oss.str(), d_sessionState, direction);

disconnect(true);
Expand Down Expand Up @@ -882,5 +883,6 @@ void Session::performDisconnectBoth()
<< ", server=" << serverCloseEc;
}
}

}
}
2 changes: 1 addition & 1 deletion tests/amqpprox_session.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void SessionTest::testSetupProxyOutOfOrderOpen(int idx)

void SessionTest::testSetupProxyReceiveClose(int idx)
{
// Client Proxy <--------Close------ Broker
// Client <--------Close------ Proxy <--------Close------ Broker
d_clientState.pushItem(idx, Data(encode(close())));

d_serverState.expect(idx, [this](const auto &items) {
Expand Down

0 comments on commit 2ecc6f5

Please sign in to comment.