Skip to content

Commit

Permalink
wip: initial version refactoring, forgotten classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Matousek committed Nov 22, 2024
1 parent 9ae90d6 commit 873b526
Show file tree
Hide file tree
Showing 9 changed files with 2,657 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/api/qpid-proton/reactor/SendingClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void SendingClient::setMessageOptions(const OptionsSetter &setter,
*
#ifdef REACTOR_PROPERTY_MAP_USES_STL
message::property_map &properties = msg.properties();
setter.setMap("msg-property", properties);
#endif // REACTOR_PROPERTY_MAP_USES_STL
*/
Expand Down Expand Up @@ -129,7 +129,7 @@ void SendingClient::setMessageProperty(message *msg, const string &property) con
if (nameVal(property, name, val, separator)) {
if (separator == "~") {
temp.resize(val.size());

std::transform(val.begin(), val.end(), temp.begin(), ::tolower);

if (temp == "true") {
Expand Down Expand Up @@ -171,7 +171,7 @@ void SendingClient::setMessageListItem(message *msg, const string &property, std
if (nameVal(property, name, val, separator)) {
if (separator == "~") {
temp.resize(val.size());

std::transform(val.begin(), val.end(), temp.begin(), ::tolower);

if (temp == "true") {
Expand Down Expand Up @@ -216,7 +216,7 @@ void SendingClient::setMessageMapItem(message *msg, const string &property, std:
if (nameVal(property, name, val, separator)) {
if (separator == "~") {
temp.resize(val.size());

std::transform(val.begin(), val.end(), temp.begin(), ::tolower);

if (temp == "true") {
Expand Down Expand Up @@ -348,14 +348,14 @@ int SendingClient::run(int argc, char **argv) const
} else {
user = uri_parser.getUser();
}

string password = "";
if (options.is_set("password")) {
password = options["password"];
} else {
password = uri_parser.getPassword();
}

string sasl_mechanisms = "";
if (options.is_set("sasl-mechanisms")) {
sasl_mechanisms = options["sasl-mechanisms"];
Expand All @@ -364,7 +364,7 @@ int SendingClient::run(int argc, char **argv) const
} else {
sasl_mechanisms = "ANONYMOUS";
}

string conn_sasl_enabled = "true";
if (options.is_set("conn-sasl-enabled")) {
conn_sasl_enabled = options["conn-sasl-enabled"];
Expand Down Expand Up @@ -505,17 +505,17 @@ int SendingClient::run(int argc, char **argv) const
setMessageText(options["msg-content"], &msg);
}


/*
* Note 1: this is a left-over from setMessageOptions. Since I don't want to
* change the method signature there, I check again here and set the remaining
* Note 1: this is a left-over from setMessageOptions. Since I don't want to
* change the method signature there, I check again here and set the remaining
* option that cannot be done implicitly above.
*
* Note 2: this is a hack for GCC ~4.4.7 on i686.
*/
*
* Note 2: this is a hack for GCC ~4.4.7 on i686.
*/
#ifndef ENABLE_IMPLICIT_CONVERSIONS
long value = options.get("msg-ttl");

msg.ttl(::proton::duration(value));
#endif
if (options.is_set("msg-group-seq")) {
Expand Down Expand Up @@ -556,13 +556,13 @@ int SendingClient::run(int argc, char **argv) const
);

handler.setMessage(msg);

int count = 1;
if (options.is_set("count")) {
count = static_cast<int> (options.get("count"));
}
handler.setCount(count);

try {
container(handler).run();

Expand Down
Loading

0 comments on commit 873b526

Please sign in to comment.