From efc1a3e98f62b64c03dcc17ec351f00970a76c6c Mon Sep 17 00:00:00 2001 From: Thomas Becker Date: Fri, 30 Nov 2012 13:54:55 +0100 Subject: [PATCH] Fix javadoc in Stream.java and logging if a Stream is committed twice --- .../java/org/eclipse/jetty/spdy/api/Stream.java | 3 +-- .../spdy/server/http/HttpTransportOverSPDY.java | 13 +++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java index 62fe3562d7b..472aa5550a2 100644 --- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java +++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java @@ -97,7 +97,7 @@ public interface Stream * * @param synInfo the metadata to send on stream creation * @return a future containing the stream once it got established - * @see #syn(SynInfo, long, TimeUnit, Callback) + * @see #syn(SynInfo, long, TimeUnit, Promise) */ public Future syn(SynInfo synInfo); @@ -159,7 +159,6 @@ public interface Stream * @param dataInfo the metadata to send * @param timeout the operation's timeout * @param unit the timeout's unit - * @param context the context passed to the callback * @param callback the completion callback that gets notified of data sent * @see #data(DataInfo) */ 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 67fd39d9e5a..b426b393e12 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 @@ -82,11 +82,10 @@ public class HttpTransportOverSPDY implements HttpTransport { EofException exception = new EofException("stream closed"); callback.failed(exception); - LOG.warn("Committed response twice.", exception); return; } // new Throwable().printStackTrace(); - + // info==null content==null lastContent==false should not happen // info==null content==null lastContent==true signals no more content - complete // info==null content!=null lastContent==false send data on committed response @@ -95,14 +94,16 @@ public class HttpTransportOverSPDY implements HttpTransport // info!=null content==null lastContent==true reply, commit and complete // info!=null content!=null lastContent==false reply, commit with content // info!=null content!=null lastContent==true reply, commit with content and complete - + boolean hasContent = BufferUtil.hasContent(content); - + if (info!=null) { if(!committed.compareAndSet(false, true)){ - callback.failed(new StreamException(stream.getId(), StreamStatus.PROTOCOL_ERROR, - "Stream already committed!")); + StreamException exception = new StreamException(stream.getId(), StreamStatus.PROTOCOL_ERROR, + "Stream already committed!"); + callback.failed(exception); + LOG.warn("Committed response twice.", exception); return; } short version = stream.getSession().getVersion();