| 197 | Iface* CreateFile(const string& name) { return new typename File<Iface>::type (name); } |
| 198 | |
| 199 | void SrtCommon::InitParameters(string host, string path, map<string,string> par) |
| 200 | { |
| 201 | // Application-specific options: mode, blocking, timeout, adapter |
| 202 | if ( Verbose::on && !par.empty()) |
| 203 | { |
| 204 | Verb() << "SRT parameters specified:\n"; |
| 205 | for (map<string,string>::iterator i = par.begin(); i != par.end(); ++i) |
| 206 | { |
| 207 | Verb() << "\t" << i->first << " = '" << i->second << "'\n"; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | if (path != "") |
| 212 | { |
| 213 | // Special case handling of an unusual specification. |
| 214 | |
| 215 | if (path.substr(0, 2) != "//") |
| 216 | { |
| 217 | Error("Path specification not supported for SRT (use // in front for special cases)"); |
| 218 | } |
| 219 | |
| 220 | path = path.substr(2); |
| 221 | |
| 222 | #if ENABLE_BONDING |
| 223 | if (path == "group") |
| 224 | { |
| 225 | // Group specified, check type. |
| 226 | m_group_type = par["type"]; |
| 227 | if (m_group_type == "") |
| 228 | { |
| 229 | Error("With //group, the group 'type' must be specified."); |
| 230 | } |
| 231 | |
| 232 | vector<string> parts; |
| 233 | Split(m_group_type, '/', back_inserter(parts)); |
| 234 | if (parts.size() == 0 || parts.size() > 2) |
| 235 | { |
| 236 | Error("Invalid specification for 'type' parameter"); |
| 237 | } |
| 238 | |
| 239 | if (parts.size() == 2) |
| 240 | { |
| 241 | m_group_type = parts[0]; |
| 242 | m_group_config = parts[1]; |
| 243 | } |
| 244 | |
| 245 | vector<string> nodes; |
| 246 | Split(par["nodes"], ',', back_inserter(nodes)); |
| 247 | |
| 248 | if (nodes.empty()) |
| 249 | { |
| 250 | Error("With //group, 'nodes' must specify comma-separated host:port specs."); |
| 251 | } |
| 252 | |
| 253 | int token = 1; |
| 254 | |
| 255 | // Check if correctly specified |
| 256 | for (string& hostport: nodes) |
nothing calls this directly
no test coverage detected