|
@@ -59,22 +59,6 @@ std::string base64_encode(const std::string & in) {
|
|
|
return out;
|
|
|
}
|
|
|
|
|
|
-std::vector<string> split(const string& str, const string& delim)
|
|
|
-{
|
|
|
- vector<string> tokens;
|
|
|
- size_t prev = 0, pos = 0;
|
|
|
- do
|
|
|
- {
|
|
|
- pos = str.find(delim, prev);
|
|
|
- if (pos == string::npos) pos = str.length();
|
|
|
- string token = str.substr(prev, pos-prev);
|
|
|
- if (!token.empty()) tokens.push_back(token);
|
|
|
- prev = pos + delim.length();
|
|
|
- }
|
|
|
- while (pos < str.length() && prev < str.length());
|
|
|
- return tokens;
|
|
|
-}
|
|
|
-
|
|
|
int main(int argc, char **argv) {
|
|
|
InitLogger(LogLevel::Warning);
|
|
|
|
|
@@ -116,9 +100,7 @@ int main(int argc, char **argv) {
|
|
|
res = cli.Get("/state/json");
|
|
|
}
|
|
|
|
|
|
- std::string description;
|
|
|
- auto parts = split(res->body, "xxxxx");
|
|
|
- pc->setRemoteDescription(parts[0]);
|
|
|
+ pc->setRemoteDescription(res->body);
|
|
|
});
|
|
|
|
|
|
pc->onStateChange([wpc = make_weak_ptr(pc)](PeerConnection::State state){
|