diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod
index 71ab903803e..2716e27fb22 100644
--- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod
+++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod
@@ -15,4 +15,4 @@ http://www.apache.org/licenses/LICENSE-2.0.html
[ini-template]
## Hide the gcloud libraries from deployed webapps
-jetty.webapp.addServerClasses+=,file:${jetty.base}/lib/gcloud/
+jetty.webapp.addServerClasses+=,${jetty.base.uri}/lib/gcloud/
diff --git a/jetty-gcloud/pom.xml b/jetty-gcloud/pom.xml
index afb7fca7710..ebdb8b987ac 100644
--- a/jetty-gcloud/pom.xml
+++ b/jetty-gcloud/pom.xml
@@ -13,7 +13,7 @@
Jetty :: GCloud
- 0.8.3-beta
+ 0.9.2-beta
diff --git a/jetty-home/src/main/resources/bin/jetty.sh b/jetty-home/src/main/resources/bin/jetty.sh
index 20949ba0db7..eec8b767ec2 100755
--- a/jetty-home/src/main/resources/bin/jetty.sh
+++ b/jetty-home/src/main/resources/bin/jetty.sh
@@ -150,6 +150,24 @@ readConfig()
source "$1"
}
+dumpEnv()
+{
+ echo "JAVA = $JAVA"
+ echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}"
+ echo "JETTY_HOME = $JETTY_HOME"
+ echo "JETTY_BASE = $JETTY_BASE"
+ echo "START_D = $START_D"
+ echo "START_INI = $START_INI"
+ echo "JETTY_START = $JETTY_START"
+ echo "JETTY_CONF = $JETTY_CONF"
+ echo "JETTY_ARGS = ${JETTY_ARGS[*]}"
+ echo "JETTY_RUN = $JETTY_RUN"
+ echo "JETTY_PID = $JETTY_PID"
+ echo "JETTY_START_LOG= $JETTY_START_LOG"
+ echo "JETTY_STATE = $JETTY_STATE"
+ echo "RUN_CMD = ${RUN_CMD[*]}"
+}
+
##################################################
@@ -278,6 +296,14 @@ then
[ -d "$JETTY_RUN" ] || mkdir $JETTY_RUN
fi
+#####################################################
+# define start log location
+#####################################################
+if [ -z "$JETTY_START_LOG" ]
+then
+ JETTY_START_LOG="$JETTY_RUN/$NAME-start.log"
+fi
+
#####################################################
# Find a pid and state file
#####################################################
@@ -401,17 +427,7 @@ RUN_CMD=("$JAVA" ${RUN_ARGS[@]})
#####################################################
if (( DEBUG ))
then
- echo "START_INI = $START_INI"
- echo "START_D = $START_D"
- echo "JETTY_HOME = $JETTY_HOME"
- echo "JETTY_BASE = $JETTY_BASE"
- echo "JETTY_CONF = $JETTY_CONF"
- echo "JETTY_PID = $JETTY_PID"
- echo "JETTY_START = $JETTY_START"
- echo "JETTY_ARGS = ${JETTY_ARGS[*]}"
- echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}"
- echo "JAVA = $JAVA"
- echo "RUN_CMD = ${RUN_CMD[*]}"
+ dumpEnv
fi
##################################################
@@ -434,7 +450,7 @@ case "$ACTION" in
CH_USER="-c$JETTY_USER"
fi
- start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_BASE" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" start-log-file="$JETTY_RUN/start.log"
+ start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_BASE" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" start-log-file="$JETTY_START_LOG"
else
@@ -456,7 +472,7 @@ case "$ACTION" in
chown "$JETTY_USER" "$JETTY_PID"
# FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc.
su - "$JETTY_USER" $SU_SHELL -c "
- exec ${RUN_CMD[*]} start-log-file="$JETTY_RUN/start.log" > /dev/null &
+ exec ${RUN_CMD[*]} start-log-file="$JETTY_START_LOG" > /dev/null &
disown \$!
echo \$! > '$JETTY_PID'"
else
@@ -569,20 +585,7 @@ case "$ACTION" in
echo "Jetty NOT running"
fi
echo
- echo "START_INI = $START_INI"
- echo "START_D = $START_D"
- echo "JETTY_HOME = $JETTY_HOME"
- echo "JETTY_BASE = $JETTY_BASE"
- echo "JETTY_CONF = $JETTY_CONF"
- echo "JETTY_PID = $JETTY_PID"
- echo "JETTY_START = $JETTY_START"
- echo "JETTY_LOGS = $JETTY_LOGS"
- echo "JETTY_STATE = $JETTY_STATE"
- echo "CLASSPATH = $CLASSPATH"
- echo "JAVA = $JAVA"
- echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}"
- echo "JETTY_ARGS = ${JETTY_ARGS[*]}"
- echo "RUN_CMD = ${RUN_CMD[*]}"
+ dumpEnv
echo
if running "$JETTY_PID"
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java
index d6ca0436c9e..63994a335d1 100644
--- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java
+++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java
@@ -55,8 +55,25 @@ public class HttpGenerator
new MetaData.Response(HttpVersion.HTTP_1_1,INTERNAL_SERVER_ERROR_500,null,new HttpFields(){{put(HttpHeader.CONNECTION,HttpHeaderValue.CLOSE);}},0);
// states
- public enum State { START, COMMITTED, COMPLETING, COMPLETING_1XX, END }
- public enum Result { NEED_CHUNK,NEED_INFO,NEED_HEADER,NEED_CHUNK_TRAILER, FLUSH,CONTINUE,SHUTDOWN_OUT,DONE}
+ public enum State
+ {
+ START,
+ COMMITTED,
+ COMPLETING,
+ COMPLETING_1XX,
+ END
+ }
+ public enum Result
+ {
+ NEED_CHUNK, // Need a small chunk buffer of CHUNK_SIZE
+ NEED_INFO, // Need the request/response metadata info
+ NEED_HEADER, // Need a buffer to build HTTP headers into
+ NEED_CHUNK_TRAILER, // Need a large chunk buffer for last chunk and trailers
+ FLUSH, // The buffers previously generated should be flushed
+ CONTINUE, // Continue generating the message
+ SHUTDOWN_OUT, // Need EOF to be signaled
+ DONE // Message generation complete
+ }
// other statics
public static final int CHUNK_SIZE = 12;
diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java
index 9abd36016c1..f743cd6620f 100644
--- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java
+++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java
@@ -125,7 +125,7 @@ public class AsyncProxyServlet extends ProxyServlet
return delegate.rewriteTarget(clientRequest);
}
}
-
+
protected class StreamReader extends IteratingCallback implements ReadListener
{
private final byte[] buffer = new byte[getHttpClient().getRequestBufferSize()];
@@ -133,6 +133,7 @@ public class AsyncProxyServlet extends ProxyServlet
private final HttpServletResponse response;
private final Request proxyRequest;
private final DeferredContentProvider provider;
+
protected StreamReader(HttpServletRequest request, HttpServletResponse response, Request proxyRequest, DeferredContentProvider provider)
{
@@ -168,9 +169,7 @@ public class AsyncProxyServlet extends ProxyServlet
int requestId = _log.isDebugEnabled() ? getRequestId(request) : 0;
ServletInputStream input = request.getInputStream();
- // First check for isReady() because it has
- // side effects, and then for isFinished().
- while (input.isReady() && !input.isFinished())
+ while (input.isReady())
{
int read = input.read(buffer);
if (_log.isDebugEnabled())
@@ -182,20 +181,17 @@ public class AsyncProxyServlet extends ProxyServlet
onRequestContent(request, proxyRequest, provider, buffer, 0, read, this);
return Action.SCHEDULED;
}
+ else if (read < 0)
+ {
+ if (_log.isDebugEnabled())
+ _log.debug("{} asynchronous read complete on {}", requestId, input);
+ return Action.SUCCEEDED;
+ }
}
- if (input.isFinished())
- {
- if (_log.isDebugEnabled())
- _log.debug("{} asynchronous read complete on {}", requestId, input);
- return Action.SUCCEEDED;
- }
- else
- {
- if (_log.isDebugEnabled())
- _log.debug("{} asynchronous read pending on {}", requestId, input);
- return Action.IDLE;
- }
+ if (_log.isDebugEnabled())
+ _log.debug("{} asynchronous read pending on {}", requestId, input);
+ return Action.IDLE;
}
protected void onRequestContent(HttpServletRequest request, Request proxyRequest, DeferredContentProvider provider, byte[] buffer, int offset, int length, Callback callback)
diff --git a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncProxyServletLoadTest.java b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java
similarity index 94%
rename from jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncProxyServletLoadTest.java
rename to jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java
index e1f46197ac4..af4a42785a0 100644
--- a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncProxyServletLoadTest.java
+++ b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java
@@ -52,18 +52,19 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@RunWith(Parameterized.class)
-public class AsyncProxyServletLoadTest
+public class ProxyServletLoadTest
{
@Parameterized.Parameters(name = "{0}")
public static Iterable