Skip to content

Commit 75158a4

Browse files
committed
Updated to 1.3.11. Added close for ws timeout
1 parent 45b131d commit 75158a4

10 files changed

Lines changed: 13 additions & 60 deletions

File tree

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.10</version>
6+
<version>1.3.11</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.10";
21+
public static final String VERSION = "Red5 Client 1.3.11";
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.10</version>
6+
<version>1.3.11</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.10</version>
127+
<version>1.3.11</version>
128128
</dependency> -->
129129
<dependency>
130130
<groupId>junit</groupId>

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.10";
58+
public static final String VERSION = "Red5 Server 1.3.11";
5959

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

6565
/**
6666
* Server capabilities

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.10</version>
6+
<version>1.3.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-io</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<name>Red5</name>
2424
<description>The Red5 server</description>
2525
<groupId>org.red5</groupId>
26-
<version>1.3.10</version>
26+
<version>1.3.11</version>
2727
<url>https://github.com/Red5/red5-server</url>
2828
<inceptionYear>2005</inceptionYear>
2929
<organization>

server/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.10</version>
6+
<version>1.3.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-server</artifactId>

server/src/main/java/org/red5/net/websocket/WebSocketConnection.java

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -320,33 +320,14 @@ public void close() {
320320
if (connected.compareAndSet(true, false)) {
321321
log.debug("close: {}", wsSessionId);
322322
WsSession session = wsSession != null ? wsSession.get() : null;
323-
//WebSocketScopeManager manager = null;
324323
// session has to be open, or user props cannot be retrieved
325324
if (session != null && session.isOpen()) {
326-
//Map<String, Object> propsMap = session.getUserProperties();
327-
// lookup the manager
328-
//manager = (WebSocketScopeManager) propsMap.get(WSConstants.WS_MANAGER);
329325
// trying to close the session nicely
330326
try {
331327
session.close();
332328
} catch (Exception e) {
333329
log.debug("Exception closing session", e);
334330
}
335-
/*
336-
// check for upgrade handler, if its around close it
337-
WsHttpUpgradeHandler upgrader = (WsHttpUpgradeHandler) propsMap.get(WSConstants.WS_UPGRADE_HANDLER);
338-
// ensure the endpoint is closed
339-
CloseReason reason = new CloseReason(CloseCodes.GOING_AWAY, "");
340-
// close the socket, don't wait for the browser to respond or we could hang
341-
session.onClose(reason);
342-
if (upgrader != null) {
343-
try {
344-
upgrader.destroy();
345-
} catch (Exception e) {
346-
log.debug("Exception destroying http upgrader", e);
347-
}
348-
}
349-
*/
350331
}
351332
// clean up our props
352333
attributes.clear();
@@ -361,10 +342,6 @@ public void close() {
361342
if (headers != null) {
362343
headers = null;
363344
}
364-
// fire callback for manager
365-
//if (manager != null) {
366-
// manager.removeConnection(this);
367-
//}
368345
if (scope.get() != null) {
369346
// disconnect from scope
370347
scope.get().removeConnection(this);
@@ -380,10 +357,10 @@ public void timeoutAsync(long now) {
380357
log.debug("timeoutAsync: {} on {} last read: {} last write: {}", now, wsSessionId, readDelta, writeDelta);
381358
if (isConnected()) {
382359
// if the delta is less than now, then the last time isn't 0
383-
if (readDelta < now && readDelta > readTimeout) {
360+
if (readDelta != now && readDelta > readTimeout) {
384361
log.warn("Read timeout: {} on id: {}", readDelta, wsSessionId);
385-
//close();
386-
} else if (writeDelta < now && writeDelta > sendTimeout) {
362+
close();
363+
} else if (writeDelta != now && writeDelta > sendTimeout) {
387364
log.warn("Write timeout: {} on id: {}", writeDelta, wsSessionId);
388365
close();
389366
}

server/src/main/java/org/red5/net/websocket/server/WsHttpUpgradeHandler.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -142,48 +142,24 @@ public void init(WebConnection connection) {
142142
wsSession = new WsSession(ep, wsRemoteEndpointServer, webSocketContainer, handshakeRequest.getRequestURI(), handshakeRequest.getParameterMap(), handshakeRequest.getQueryString(), handshakeRequest.getUserPrincipal(), httpSessionId, negotiatedExtensions, subProtocol, pathParameters, secure, endpointConfig);
143143
// newest ctor
144144
//wsSession = new WsSession(wsRemoteEndpointServer, webSocketContainer, handshakeRequest.getRequestURI(), handshakeRequest.getParameterMap(), handshakeRequest.getQueryString(), handshakeRequest.getUserPrincipal(), httpSessionId, negotiatedExtensions, subProtocol, pathParameters, secure, endpointConfig);
145-
if (isTrace) {
146-
log.trace("New connection 2 {}", wsSession);
147-
}
148145
wsFrame = new WsFrameServer(socketWrapper, upgradeInfo, wsSession, transformation, applicationClassLoader);
149-
if (isTrace) {
150-
log.trace("New connection 3 {}", wsFrame);
151-
}
152146
// WsFrame adds the necessary final transformations. Copy the completed transformation chain to the remote end point.
153147
wsRemoteEndpointServer.setTransformation(wsFrame.getTransformation());
154-
if (isTrace) {
155-
log.trace("New connection 4");
156-
}
157148
// get the ws scope manager from user props
158149
WebSocketScopeManager manager = (WebSocketScopeManager) endpointConfig.getUserProperties().get(WSConstants.WS_MANAGER);
159-
if (isTrace) {
160-
log.trace("New connection 5");
161-
}
162150
// get ws scope from user props
163151
WebSocketScope scope = (WebSocketScope) endpointConfig.getUserProperties().get(WSConstants.WS_SCOPE);
164-
if (isTrace) {
165-
log.trace("New connection 6 - Scope: {} WS session: {}", scope, wsSession);
166-
}
167152
// create a ws connection instance
168153
WebSocketConnection conn = new WebSocketConnection(scope, wsSession);
169-
// in debug check since WebSocketConnection.toString is a tiny bit expensive
170-
if (isTrace) {
171-
log.trace("New connection 7: {}", conn);
172-
}
173154
// set ip and port
174155
conn.setAttribute(WSConstants.WS_HEADER_REMOTE_IP, socketWrapper.getRemoteAddr());
175156
conn.setAttribute(WSConstants.WS_HEADER_REMOTE_PORT, socketWrapper.getRemotePort());
176157
// add the request headers
177158
conn.setHeaders(handshakeRequest.getHeaders());
178-
if (isTrace) {
179-
log.trace("New connection 8: {}", conn);
180-
}
181159
// add the connection to the user props
182160
endpointConfig.getUserProperties().put(WSConstants.WS_CONNECTION, conn);
183161
// must be added to the session as well since the session ctor copies from the endpoint and doesnt update
184162
wsSession.getUserProperties().put(WSConstants.WS_CONNECTION, conn);
185-
// set the upgrade handler so it can be destroyed when ws conn is closed
186-
wsSession.getUserProperties().put(WSConstants.WS_UPGRADE_HANDLER, this);
187163
// set connected flag
188164
conn.setConnected();
189165
// fire endpoint handler

service/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.10</version>
6+
<version>1.3.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-service</artifactId>

0 commit comments

Comments
 (0)