Skip to content

Commit

Permalink
設定方法の見直しと、不要な処理を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
torikizi committed Dec 30, 2024
1 parent b9e59d7 commit c9087e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Sora/Sora.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,7 @@ public void Connect(Config config)
}
if (m.Header != null)
{
var header = new SoraConf.Internal.DataChannel.Header();
header.content.AddRange(m.Header);
c.SetHeader(header);
c.SetHeader(new SoraConf.Internal.DataChannel.Header { content = new List<string>(m.Header) });
}
cc.data_channels.Add(c);
}
Expand Down
3 changes: 1 addition & 2 deletions src/sora.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,11 @@ void Sora::DoConnect(const sora_conf::internal::ConnectConfig& cc,
}
if (dc.has_header()) {
d.header = std::vector<boost::json::value>();
d.header->reserve(dc.header.content.size());
for (const auto& json_str : dc.header.content) {
boost::system::error_code ec;
auto parsed = boost::json::parse(json_str, ec);
if (ec) {
RTC_LOG(LS_WARNING) << "Invalid JSON in header: " << json_str;
RTC_LOG(LS_WARNING) << "Invalid JSON: header=" << json_str;
} else {
d.header->push_back(std::move(parsed));
}
Expand Down

0 comments on commit c9087e4

Please sign in to comment.