Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2011-04-13 21:45:36 -0400
committerGreg Wilkins2011-04-13 21:45:36 -0400
commit975ee04df40ff8b27dafef16000a9bebac56ed86 (patch)
treeb3b3c8d1047043bd3ea59ed6ea8c356dfbdffced
parenteee81312e4b33252ae3c2768f8476d13dff2e4a4 (diff)
downloadorg.eclipse.jetty.project-975ee04df40ff8b27dafef16000a9bebac56ed86.tar.gz
org.eclipse.jetty.project-975ee04df40ff8b27dafef16000a9bebac56ed86.tar.xz
org.eclipse.jetty.project-975ee04df40ff8b27dafef16000a9bebac56ed86.zip
minor cleanup of variable names and ordering
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3015 7e9141cc-0065-0410-87d8-b60c137991c4
-rw-r--r--jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java
index 8d870b2651..2ea60826bb 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java
@@ -493,7 +493,7 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
public void onFrame(byte flags, byte opcode, Buffer buffer)
{
- boolean more=(flags&0x8)==0;
+ boolean lastFrame = isLastFrame(flags);
synchronized(WebSocketConnectionD06.this)
{
@@ -528,7 +528,7 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
if (_utf8.append(buffer.array(),buffer.getIndex(),buffer.length(),_connection.getMaxTextMessageSize()))
{
// If this is the last fragment, deliver the text buffer
- if (more && _onTextMessage!=null)
+ if (lastFrame && _onTextMessage!=null)
{
_opcode=-1;
String msg =_utf8.toString();
@@ -541,8 +541,7 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
_connection.close(WebSocketConnectionD06.CLOSE_LARGE,"Text message size > "+_connection.getMaxTextMessageSize()+" chars");
_utf8.reset();
_opcode=-1;
- }
-
+ }
}
else if (_opcode>=0 && _connection.getMaxBinaryMessageSize()>=0)
{
@@ -557,7 +556,7 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
_aggregate.put(buffer);
// If this is the last fragment, deliver
- if (!more && _onBinaryMessage!=null)
+ if (lastFrame && _onBinaryMessage!=null)
{
try
{
@@ -606,7 +605,12 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
{
if(_onTextMessage!=null)
{
- if (more)
+ if (lastFrame)
+ {
+ // Deliver the message
+ _onTextMessage.onMessage(buffer.toString(StringUtil.__UTF8));
+ }
+ else
{
if (_connection.getMaxTextMessageSize()>=0)
{
@@ -621,11 +625,6 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
}
}
}
- else
- {
- // Deliver the message
- _onTextMessage.onMessage(buffer.toString(StringUtil.__UTF8));
- }
}
break;
}
@@ -634,7 +633,11 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
{
if (_onBinaryMessage!=null)
{
- if (more)
+ if (lastFrame)
+ {
+ _onBinaryMessage.onMessage(array,buffer.getIndex(),buffer.length());
+ }
+ else
{
if (_connection.getMaxBinaryMessageSize()>=0)
{
@@ -654,10 +657,6 @@ public class WebSocketConnectionD06 extends AbstractConnection implements WebSoc
}
}
}
- else
- {
- _onBinaryMessage.onMessage(array,buffer.getIndex(),buffer.length());
- }
}
}
}

Back to the top