Fix javadoc in Stream.java and logging if a Stream is committed twice
This commit is contained in:
parent
b3e1114313
commit
efc1a3e98f
|
@ -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<Stream> 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)
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue