Skip to content

Commit af3ac05

Browse files
authored
Fixes #7951 - OutputStreamContentProvider blocks forever during an HTTP2 upload after idle timeout is reached. (#12312)
Improved javadocs. Signed-off-by: Simone Bordet <[email protected]>
1 parent 04fd45d commit af3ac05

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/OutputStreamRequestContent.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* <p>Content must be provided by writing to the {@link #getOutputStream() output stream}
2727
* that must be {@link OutputStream#close() closed} when all content has been provided.</p>
2828
* <p>Example usage:</p>
29-
* <pre>
29+
* <pre>{@code
3030
* HttpClient httpClient = ...;
3131
*
3232
* // Use try-with-resources to autoclose the output stream.
@@ -37,7 +37,7 @@
3737
* .body(content)
3838
* .send(new Response.CompleteListener()
3939
* {
40-
* &#64;Override
40+
* @Override
4141
* public void onComplete(Result result)
4242
* {
4343
* // Your logic here
@@ -50,7 +50,7 @@
5050
* // Even later...
5151
* output.write("more content".getBytes());
5252
* } // Implicit call to output.close().
53-
* </pre>
53+
* }</pre>
5454
*/
5555
public class OutputStreamRequestContent extends OutputStreamContentSource implements Request.Content
5656
{

jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/content/OutputStreamContentSource.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323
import org.eclipse.jetty.util.IO;
2424

2525
/**
26-
* <p>
27-
* A {@link Content.Source} backed by an {@link OutputStream}.
28-
* Any bytes written to the {@link OutputStream} returned by {@link #getOutputStream()}
29-
* is converted to a {@link Content.Chunk} and returned from {@link #read()}. If
30-
* necessary, any {@link Runnable} passed to {@link #demand(Runnable)} is invoked.
31-
* </p>
26+
* <p>A {@link Content.Source} that provides content asynchronously through an {@link OutputStream}.</p>
27+
* <p>Bytes written to the {@link OutputStream} returned by {@link #getOutputStream()}
28+
* are converted to a {@link Content.Chunk} and returned from {@link #read()}.</p>
29+
* <p>The {@code OutputStream} must be closed to signal that all the content has been written.</p>
30+
*
3231
* @see AsyncContent
3332
*/
3433
public class OutputStreamContentSource implements Content.Source, Closeable

0 commit comments

Comments
 (0)