aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-07-05 06:02:52 (EDT)
committerThomas Becker2013-07-05 06:02:52 (EDT)
commit2d911612a0553516f76a58188b761794cfb7c149 (patch)
tree62e3cf436a7a521b20a14fa1144003b5c55781f7
parent5d1225b60e7a96d926d5e8f77f829826d4321fdf (diff)
downloadorg.eclipse.jetty.project-2d911612a0553516f76a58188b761794cfb7c149.zip
org.eclipse.jetty.project-2d911612a0553516f76a58188b761794cfb7c149.tar.gz
org.eclipse.jetty.project-2d911612a0553516f76a58188b761794cfb7c149.tar.bz2
412318 HttpChannel fix multiple calls to _transport.completed() if handle() is called multiple times while the channel is COMPLETED
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java11
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java17
2 files changed, 10 insertions, 18 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java
index f03f6db..ae28048 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java
@@ -235,8 +235,6 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
public boolean handle()
{
LOG.debug("{} handle enter", this);
- if(_state.isCompleted())
- return false;
setCurrentHttpChannel(this);
@@ -332,16 +330,11 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
}
finally
{
- next=Next.RECYCLE;
+ _request.setHandled(true);
+ _transport.completed();
}
}
- if (next==Next.RECYCLE)
- {
- _request.setHandled(true);
- _transport.completed();
- }
-
LOG.debug("{} handle exit, result {}", this, next);
return next!=Next.WAIT;
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java
index a117b8e..10ee7bc 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java
@@ -71,13 +71,12 @@ public class HttpChannelState
COMPLETING, // Request is completable
COMPLETED // Request is complete
}
-
+
public enum Next
{
CONTINUE, // Continue handling the channel
WAIT, // Wait for further events
- COMPLETE, // Complete the channel
- RECYCLE, // Channel is completed
+ COMPLETE // Complete the channel
}
private final HttpChannel<?> _channel;
@@ -190,12 +189,12 @@ public class HttpChannelState
case COMPLETING:
return Next.COMPLETE;
-
+
case ASYNCWAIT:
return Next.WAIT;
-
+
case COMPLETED:
- return Next.RECYCLE;
+ return Next.WAIT;
case REDISPATCH:
_state=State.REDISPATCHED;
@@ -325,7 +324,7 @@ public class HttpChannelState
_event.setDispatchTarget(context,path);
_dispatched=true;
break;
-
+
default:
throw new IllegalStateException(this.getStatusString());
}
@@ -393,7 +392,7 @@ public class HttpChannelState
break;
}
}
-
+
scheduleDispatch();
}
@@ -528,7 +527,7 @@ public class HttpChannelState
return _expired;
}
}
-
+
public boolean isInitial()
{
synchronized(this)