From 6c3b01f09c4b02f50643e9e92bfefd47e975145d Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Tue, 13 Dec 2016 13:23:21 +0100 Subject: [PATCH] AttachChannel must update the config after it's done, use boost::split --- fairmq/FairMQChannel.cxx | 12 +++--------- fairmq/FairMQDevice.cxx | 6 ++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fairmq/FairMQChannel.cxx b/fairmq/FairMQChannel.cxx index 7b67baff..58df6a2c 100644 --- a/fairmq/FairMQChannel.cxx +++ b/fairmq/FairMQChannel.cxx @@ -14,6 +14,8 @@ #include +#include // join/split + #include "FairMQChannel.h" #include "FairMQLogger.h" @@ -784,13 +786,5 @@ FairMQChannel::~FairMQChannel() void FairMQChannel::Tokenize(vector& output, const string& input, const string delimiters) { - size_t start = 0; - size_t end = input.find_first_of(delimiters); - while (end != string::npos) - { - output.push_back(input.substr(start, end-start)); - start = ++end; - end = input.find_first_of(delimiters, start); - } - output.push_back(input.substr(start)); + boost::algorithm::split(output, input, boost::algorithm::is_any_of(delimiters)); } diff --git a/fairmq/FairMQDevice.cxx b/fairmq/FairMQDevice.cxx index 3db77626..d6a8bb3f 100644 --- a/fairmq/FairMQDevice.cxx +++ b/fairmq/FairMQDevice.cxx @@ -26,6 +26,8 @@ #include // for the InteractiveStateLoop #include +#include // join/split + #include "FairMQSocket.h" #include "FairMQDevice.h" #include "FairMQLogger.h" @@ -348,6 +350,10 @@ bool FairMQDevice::AttachChannel(FairMQChannel& ch) // after the book keeping is done, exit in case of errors if (!rc) return rc; } + + // put the (possibly) modified address back in the config + ch.UpdateAddress(boost::algorithm::join(endpoints, ",")); + return true; }