aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-10-24 10:37:07 (EDT)
committerThomas Becker2012-10-24 10:41:09 (EDT)
commit35b7a0a62dae0469d41294ffd82a47fa9a4ae907 (patch)
tree6ef2301a2a66df59fc34db8223a84e6db7ee20cc
parente4069c69390a1864b41f4b90c3c6c9f21b5a6109 (diff)
downloadorg.eclipse.jetty.project-35b7a0a62dae0469d41294ffd82a47fa9a4ae907.zip
org.eclipse.jetty.project-35b7a0a62dae0469d41294ffd82a47fa9a4ae907.tar.gz
org.eclipse.jetty.project-35b7a0a62dae0469d41294ffd82a47fa9a4ae907.tar.bz2
block instead of copy
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
index d607404..eff5ca3 100644
--- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
+++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
@@ -96,12 +96,12 @@ public class HttpTransportOverSPDY implements HttpTransport
}
}
- boolean noContent = BufferUtil.isEmpty(content);
- boolean close = noContent && lastContent;
+ boolean hasContent = !BufferUtil.isEmpty(content);
+ boolean close = !hasContent && lastContent;
reply(stream, new ReplyInfo(headers, close));
- if (!noContent)
- stream.data(new ByteBufferDataInfo(content, lastContent));
+ if (hasContent)
+ sendToStream(content, lastContent);
}
@Override
@@ -111,7 +111,20 @@ public class HttpTransportOverSPDY implements HttpTransport
// TODO work out if we can avoid double calls for lastContent==true
if (stream.isClosed() && BufferUtil.isEmpty(content) && lastContent)
return;
- stream.data(new ByteBufferDataInfo(content, lastContent));
+
+ sendToStream(content, lastContent);
+ }
+
+ private void sendToStream(ByteBuffer content, boolean lastContent)
+ {
+ try
+ {
+ stream.data(new ByteBufferDataInfo(content, lastContent)).get();
+ }
+ catch (Exception e)
+ {
+ endPoint.close();
+ }
}
@Override