You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
void ConferenceSocketSignalingChannel::OnReconnectionTicket(
const std::string& ticket) {
RTC_LOG(LS_VERBOSE) << "On reconnection ticket: " << ticket;
reconnection_ticket_ = ticket;
uint64_t now(0);
// rtc::TimeMillis() seems not work well on iOS. It returns half of the actual
// value on iPhone 6.
#if defined(WEBRTC_IOS)
now = CFAbsoluteTimeGetCurrent();
now += kMachLinuxTimeDelta;
now *= 1000;
#else
now = rtc::TimeMillis();
#endif
std::string ticket_decoded(
rtc::Base64::Decode(reconnection_ticket_, rtc::Base64::DO_STRICT));
Json::Value ticket_json;
Json::Reader ticket_reader;
if (!ticket_reader.parse(ticket_decoded, ticket_json)) {
RTC_NOTREACHED();
RTC_LOG(LS_WARNING) << "Cannot parse reconnection ticket.";
return;
}
Json::Value expiration_json;
std::string expiration_str;
if (rtc::GetValueFromJsonObject(ticket_json, "notAfter", &expiration_json)) {
expiration_str = expiration_json.asString();
auto expiration_time = std::stoll(expiration_str);
int delay(expiration_time - now);
if (delay < 0) {
RTC_LOG(LS_WARNING)
<< "Reconnection ticket expiration time is earlier than now.";
delay = 5 * 60 * 1000; // Set delay to 5 mins.
}
RTC_LOG(LS_VERBOSE) << "Reconnection ticket will expire in: " << delay / 1000
<< "seconds";
std::weak_ptr weak_this =
shared_from_this();
std::thread(weak_this, delay {
std::this_thread::sleep_for(std::chrono::milliseconds(delay));
auto that = weak_this.lock();
if (!that) {
return;
}
that->RefreshReconnectionTicket();
}).detach();
}
}
in ConferenceSocketSignalingChannel::OnReconnectionTicket now = rtc::TimeMillis(); return the time is not utc time but the notAfter is utc time.
{"participantId":"gJamTJBczCTb9wsIAAAD","ticketId":"acif9iqe8rm","notBefore":1676448122238,"notAfter":1676448722238,"signature":"YmI5YTliZDY4MzY0YWNkYmU4ZWU3NjJiYjE4ZDI0Nzg3OWNlMjhiYTAzODNlMDU0YTZlZDAwOGM3ZG......."}
So is this a bug?
The text was updated successfully, but these errors were encountered: