Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 2686c3e

Browse files
committed
Merge pull request #191.
2 parents 2525da2 + c4ca0bd commit 2686c3e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyConnector.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,18 @@ public OutputStream getOutputStream(final int contentLength) throws IOException
363363
return streamContentProvider.getOutputStream();
364364
}
365365
});
366+
return streamContentProvider;
367+
}
366368

367-
try {
369+
private void processContent(final ClientRequest clientRequest, final ContentProvider entity) throws IOException {
370+
if (entity == null) {
371+
return;
372+
}
373+
374+
final OutputStreamContentProvider streamContentProvider = (OutputStreamContentProvider) entity;
375+
try (final OutputStream output = streamContentProvider.getOutputStream()) {
368376
clientRequest.writeEntity();
369-
} catch (final IOException e) {
370-
throw new ProcessingException("Failed to write request entity.", e);
371377
}
372-
return streamContentProvider;
373378
}
374379

375380
@Override
@@ -446,6 +451,7 @@ public void onFailure(final Response response, final Throwable t) {
446451
}
447452
}
448453
});
454+
processContent(jerseyRequest, entity);
449455
return responseFuture;
450456
} catch (final Throwable t) {
451457
failure = t;

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@
18741874
<jersey1.last.final.version>${jersey1.version}</jersey1.last.final.version>
18751875
<jettison.version>1.3.7</jettison.version>
18761876
<jetty.plugin.version>6.1.24</jetty.plugin.version>
1877-
<jetty.version>9.1.1.v20140108</jetty.version>
1877+
<jetty.version>9.2.14.v20151106</jetty.version>
18781878
<jetty.servlet.api.25.version>6.1.14</jetty.servlet.api.25.version>
18791879
<jmh.version>1.10.2</jmh.version>
18801880
<jmockit.version>1.18</jmockit.version>

0 commit comments

Comments
 (0)