Commit 3a07d07e authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner

[1924] Less confusing parameter names for sendmsg

Changed to header and payload, which removes the confusion of the first
part message being called env and the other called msg in one send and
the first being msg (and the second omitted) in the second case.
parent 6c5b161b
......@@ -343,8 +343,8 @@ Session::establish(const char* socket_file) {
// prefix.
Session::sendmsg(ConstElementPtr msg) {
std::string header_wire = msg->toWire();
Session::sendmsg(ConstElementPtr header) {
std::string header_wire = header->toWire();
unsigned int length = 2 + header_wire.length();
unsigned int length_net = htonl(length);
unsigned short header_length = header_wire.length();
......@@ -356,9 +356,9 @@ Session::sendmsg(ConstElementPtr msg) {
Session::sendmsg(ConstElementPtr env, ConstElementPtr msg) {
std::string header_wire = env->toWire();
std::string body_wire = msg->toWire();
Session::sendmsg(ConstElementPtr header, ConstElementPtr payload) {
std::string header_wire = header->toWire();
std::string body_wire = payload->toWire();
unsigned int length = 2 + header_wire.length() + body_wire.length();
unsigned int length_net = htonl(length);
unsigned short header_length = header_wire.length();
......@@ -172,9 +172,9 @@ namespace isc {
// replace them. It is not expected to be specialized by a derived
// class. Actually, it is not expected to inherit from this class
// to begin with.
virtual void sendmsg(isc::data::ConstElementPtr msg);
virtual void sendmsg(isc::data::ConstElementPtr env,
isc::data::ConstElementPtr msg);
virtual void sendmsg(isc::data::ConstElementPtr header);
virtual void sendmsg(isc::data::ConstElementPtr header,
isc::data::ConstElementPtr payload);
bool recvmsg(isc::data::ConstElementPtr& msg,
bool nonblock = true,
......@@ -149,11 +149,11 @@ public:
// Override the sendmsg. They are not sent over the real connection, but
// stored locally and can be extracted by getSentMessage()
virtual void sendmsg(ConstElementPtr msg) {
sendmsg(msg, ConstElementPtr(new isc::data::NullElement));
virtual void sendmsg(ConstElementPtr header) {
sendmsg(header, ConstElementPtr(new isc::data::NullElement));
virtual void sendmsg(ConstElementPtr env, ConstElementPtr msg) {
sent_messages_.push_back(SentMessage(env, msg));
virtual void sendmsg(ConstElementPtr header, ConstElementPtr payload) {
sent_messages_.push_back(SentMessage(header, payload));
// The sendmsg stores data here.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment