mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: avoid race condition on GET session (null values)
parent
dd0016671e
commit
bab46cdf8b
|
@ -31,6 +31,7 @@ import org.kurento.client.ErrorEvent;
|
|||
import org.kurento.client.Filter;
|
||||
import org.kurento.client.GenericMediaElement;
|
||||
import org.kurento.client.IceCandidate;
|
||||
import org.kurento.client.IceComponentState;
|
||||
import org.kurento.client.MediaElement;
|
||||
import org.kurento.client.MediaPipeline;
|
||||
import org.kurento.client.MediaType;
|
||||
|
@ -665,7 +666,9 @@ public class KurentoParticipant extends Participant {
|
|||
});
|
||||
|
||||
endpoint.getWebEndpoint().addIceComponentStateChangeListener(event -> {
|
||||
endpoint.kmsEvents.add(new KmsEvent(event, endpoint.createdAt()));
|
||||
if (!event.getState().equals(IceComponentState.READY)) {
|
||||
endpoint.kmsEvents.add(new KmsEvent(event, endpoint.createdAt()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.kurento.client.OnIceCandidateEvent;
|
|||
import org.kurento.client.RtpEndpoint;
|
||||
import org.kurento.client.SdpEndpoint;
|
||||
import org.kurento.client.WebRtcEndpoint;
|
||||
import org.kurento.client.internal.server.KurentoServerException;
|
||||
import org.kurento.jsonrpc.JsonUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -500,7 +501,11 @@ public abstract class MediaEndpoint {
|
|||
public JsonObject withStatsToJson() {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("createdAt", this.createdAt);
|
||||
json.addProperty("webrtcTagName", this.getEndpoint().getTag("name"));
|
||||
try {
|
||||
json.addProperty("webrtcTagName", this.getEndpoint().getTag("name"));
|
||||
} catch (KurentoServerException ex) {
|
||||
json.addProperty("webrtcTagName", "NOT_FOUND");
|
||||
}
|
||||
json.add("receivedCandidates", new GsonBuilder().create().toJsonTree(this.receivedCandidateList));
|
||||
json.addProperty("localCandidate", this.selectedLocalIceCandidate);
|
||||
json.addProperty("remoteCandidate", this.selectedRemoteIceCandidate);
|
||||
|
|
|
@ -77,8 +77,16 @@ public class SubscriberEndpoint extends MediaEndpoint {
|
|||
@Override
|
||||
public JsonObject toJson() {
|
||||
JsonObject json = super.toJson();
|
||||
json.addProperty("streamId", this.publisher.getEndpoint().getTag("name"));
|
||||
json.addProperty("publisher", this.publisher.getEndpointName());
|
||||
try {
|
||||
json.addProperty("streamId", this.publisher.getEndpoint().getTag("name"));
|
||||
} catch (NullPointerException ex) {
|
||||
json.addProperty("streamId", "NOT_FOUND");
|
||||
}
|
||||
try {
|
||||
json.addProperty("publisher", this.publisher.getEndpointName());
|
||||
} catch (NullPointerException ex) {
|
||||
json.addProperty("publisher", "NOT_FOUND");
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue