X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fconfig.cpp;h=e88ec2bee52e3331a9c67ea13777964832826c41;hb=cb4c74b47e6643f15e503067c197f86cbc5e6263;hp=b746bad11a88049338853537be38250c1297bb6a;hpb=ab317a7803ad0ff688ab8fb452d13d8bdd09fd60;p=cassiopeia.git diff --git a/src/config.cpp b/src/config.cpp index b746bad..e88ec2b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -88,12 +88,29 @@ int parseProfiles() { prof.eku = map->at( "eku" ); prof.ku = map->at( "ku" ); - if( CAs.find( map->at( "ca" ) ) == CAs.end() ) { - std::shared_ptr ca( new CAConfig( map->at( "ca" ) ) ); - CAs.emplace( map->at( "ca" ), ca ); - } + std::string cas = map->at( "ca" ); + + for( size_t pos = 0; pos != std::string::npos; ) { + size_t end = cas.find( ",", pos ); + std::string sub; + + if( end == std::string::npos ) { + sub = cas.substr( pos ); + } else { + sub = cas.substr( pos, end - pos ); + end++; + } + + pos = end; - prof.ca = CAs.at( map->at( "ca" ) ); + if( CAs.find( sub ) == CAs.end() ) { + std::shared_ptr ca( new CAConfig( sub ) ); + CAs.emplace( sub, ca ); + } + + prof.ca.push_back( CAs.at( sub ) ); + + } profiles.emplace( profileName, prof ); std::cout << "Profile: " << profileName << " up and running." << std::endl;