\r
boost::property_tree::write_xml(replyString, info, w);\r
}\r
- else // channel\r
+ else if(_parameters.size() >= 1 && _parameters[0] == L"SERVER")\r
{\r
- replyString << TEXT("201 INFO OK\r\n");\r
+ replyString << L"201 INFO SYSTEM OK\r\n";\r
\r
boost::property_tree::wptree info;\r
+\r
+ int index = 0;\r
+ BOOST_FOREACH(auto channel, channels_)\r
+ info.add_child(L"channels.channel", channel->info())\r
+ .add(L"index", ++index);\r
+ \r
+ boost::property_tree::write_xml(replyString, info, w);\r
+ }\r
+ else // channel\r
+ { \r
if(_parameters.size() >= 1)\r
{\r
+ replyString << TEXT("201 INFO OK\r\n");\r
+ boost::property_tree::wptree info;\r
+\r
std::vector<std::wstring> split;\r
boost::split(split, _parameters[0], boost::is_any_of("-"));\r
\r
.add(L"index", layer);\r
}\r
}\r
+ boost::property_tree::xml_parser::write_xml(replyString, info, w);\r
}\r
else\r
{\r
- int index = 0;\r
- BOOST_FOREACH(auto channel, channels_)\r
- info.add_child(L"channels.channel", channel->info())\r
- .add(L"index", ++index);\r
+ // This is needed for backwards compatibility with old clients\r
+ replyString << TEXT("200 INFO OK\r\n");\r
+ for(size_t n = 0; n < channels_.size(); ++n)\r
+ GenerateChannelInfo(n, channels_[n], replyString);\r
+ replyString << TEXT("\r\n");\r
}\r
\r
- boost::property_tree::xml_parser::write_xml(replyString, info, w);\r
}\r
}\r
catch(...)\r