From a1032465b8821229b27f3f290a45179c7d54424b Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 23 Jul 2013 15:17:33 +0200 Subject: [PATCH] Improved documentation. --- .../java/org/eclipse/jetty/client/HttpContent.java | 13 +++++++++++++ .../java/org/eclipse/jetty/client/HttpSender.java | 2 ++ 2 files changed, 15 insertions(+) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java index 00d92a7bcd6..989e7f22a5d 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java @@ -24,6 +24,7 @@ import java.util.Iterator; import org.eclipse.jetty.client.api.ContentProvider; import org.eclipse.jetty.client.util.DeferredContentProvider; +import org.eclipse.jetty.util.BufferUtil; /** * {@link HttpContent} is a stateful, linear representation of the request content provided @@ -140,4 +141,16 @@ public class HttpContent { return content == AFTER; } + + @Override + public String toString() + { + return String.format("%s@%x - has=%b,last=%b,consumed=%b,buffer=%s", + getClass().getSimpleName(), + hashCode(), + hasContent(), + isLast(), + isConsumed(), + BufferUtil.toDetailString(getContent())); + } } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java index 4be6b9b9d18..b465c6d240e 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java @@ -728,6 +728,8 @@ public abstract class HttpSender implements AsyncContentProvider.Listener @Override protected void completed() { + // Nothing to do, since we always return false from process(). + // Termination is obtained via LastContentCallback. } @Override