Skip to content

Commit fa13a16

Browse files
committed
Consolidated logger for AttributeStore impls. Added rtc and http to IConnection encodings. Added deleteStream protection against non-publisher. Removed extra WS timeout logic
1 parent a71dbcb commit fa13a16

File tree

19 files changed

+100
-79
lines changed

19 files changed

+100
-79
lines changed

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>1.3.13</version>
6+
<version>1.3.14</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-client</artifactId>

client/src/main/java/org/red5/client/Red5Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public final class Red5Client {
1818
/**
1919
* Current server version with revision
2020
*/
21-
public static final String VERSION = "Red5 Client 1.3.13";
21+
public static final String VERSION = "Red5 Client 1.3.14";
2222

2323
/**
2424
* Create a new Red5Client object using the connection local to the current thread A bit of magic that lets you access the red5 scope

common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>1.3.13</version>
6+
<version>1.3.14</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-server-common</artifactId>
@@ -124,7 +124,7 @@
124124
<dependency>
125125
<groupId>net.engio</groupId>
126126
<artifactId>mbassador</artifactId>
127-
<version>1.3.13</version>
127+
<version>1.3.14</version>
128128
</dependency> -->
129129
<dependency>
130130
<groupId>junit</groupId>

common/src/main/java/org/red5/server/AttributeStore.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626

2727
public class AttributeStore implements ICastingAttributeStore {
2828

29-
protected static Logger log = LoggerFactory.getLogger(AttributeStore.class);
29+
protected Logger log = LoggerFactory.getLogger(getClass());
30+
31+
protected boolean isTrace = log.isTraceEnabled();
32+
33+
protected boolean isDebug = log.isDebugEnabled();
3034

3135
/**
3236
* Map for attributes with initialCapacity = 1, loadFactor = .9, concurrencyLevel = (# of processors)

common/src/main/java/org/red5/server/BaseConnection.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@
2828
import org.red5.server.api.scope.IScope;
2929
import org.red5.server.scope.Scope;
3030
import org.red5.server.so.SharedObjectScope;
31-
import org.slf4j.Logger;
32-
import org.slf4j.LoggerFactory;
3331

3432
/**
3533
* Base abstract class for connections. Adds connection specific functionality like work with clients to AttributeStore.
3634
*/
3735
public abstract class BaseConnection extends AttributeStore implements IConnection {
3836

39-
private static final Logger log = LoggerFactory.getLogger(BaseConnection.class);
40-
4137
/**
4238
* Connection type
4339
*/

common/src/main/java/org/red5/server/api/IConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface IConnection extends ICoreObject, ICastingAttributeStore {
3030
* Encoding type.
3131
*/
3232
public static enum Encoding {
33-
AMF0, AMF3, WEBSOCKET, SOCKETIO, RTP, SRTP, BLOB, RAW, RTSP, SRT, MPEGTS, DATACHANNEL
33+
AMF0, AMF3, WEBSOCKET, SOCKETIO, RTP, SRTP, BLOB, RAW, RTSP, SRT, MPEGTS, DATACHANNEL, WEBRTC, HTTP
3434
};
3535

3636
/**

common/src/main/java/org/red5/server/api/Red5.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public final class Red5 {
5555
/**
5656
* Server version with revision
5757
*/
58-
public static final String VERSION = "Red5 Server 1.3.13";
58+
public static final String VERSION = "Red5 Server 1.3.14";
5959

6060
/**
6161
* Server version for fmsVer requests
6262
*/
63-
public static final String FMS_VERSION = "RED5/1,3,13,0";
63+
public static final String FMS_VERSION = "RED5/1,3,14,0";
6464

6565
/**
6666
* Server capabilities

common/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@
7777
import org.red5.server.stream.SingleItemSubscriberStream;
7878
import org.red5.server.stream.StreamService;
7979
import org.red5.server.util.ScopeUtils;
80-
import org.slf4j.Logger;
81-
import org.slf4j.LoggerFactory;
8280
import org.springframework.core.task.TaskRejectedException;
8381
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
8482
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
@@ -92,12 +90,6 @@
9290
*/
9391
public abstract class RTMPConnection extends BaseConnection implements IStreamCapableConnection, IServiceCapableConnection, IReceivedMessageTaskQueueListener {
9492

95-
private static Logger log = LoggerFactory.getLogger(RTMPConnection.class);
96-
97-
private static boolean isTrace = log.isTraceEnabled();
98-
99-
private static boolean isDebug = log.isDebugEnabled();
100-
10193
public static final String RTMP_SESSION_ID = "rtmp.sessionid";
10294

10395
public static final String RTMP_HANDSHAKE = "rtmp.handshake";

common/src/main/java/org/red5/server/stream/StreamService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,20 @@ public void deleteStream(Number streamId) {
226226
public void deleteStream(IStreamCapableConnection conn, Number streamId) {
227227
IClientStream stream = conn.getStreamById(streamId);
228228
if (stream != null) {
229+
log.debug("Delete id: {} stream: {}", streamId, stream);
230+
if (!IConnection.Duty.PUBLISHER.equals(conn.getDuty())) {
231+
// this is a subscriber dont close / delete the stream
232+
log.warn("Connection is not a publisher, not closing stream");
233+
return;
234+
}
229235
if (stream instanceof IClientBroadcastStream) {
230236
IClientBroadcastStream bs = (IClientBroadcastStream) stream;
231237
IBroadcastScope bsScope = getBroadcastScope(conn.getScope(), bs.getPublishedName());
232238
if (bsScope != null && conn instanceof BaseConnection) {
233239
((BaseConnection) conn).unregisterBasicScope(bsScope);
234240
}
241+
} else {
242+
log.debug("Stream is not instance of IClientBroadcastStream");
235243
}
236244
stream.close();
237245
}

io/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>1.3.13</version>
6+
<version>1.3.14</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-io</artifactId>

0 commit comments

Comments
 (0)