Skip to content

Commit 6811cdb

Browse files
committed
Simplify Logic
1 parent 2b24595 commit 6811cdb

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

‎httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -283,25 +283,21 @@ public void close() throws IOException {
283283
}
284284

285285
}, entity.getTrailers());
286-
boolean abort = true;
287286
try {
288-
try {
289-
entity.writeTo(outStream);
290-
outStream.close();
291-
} catch (final ResponseOutOfOrderException ex) {
292-
if (len != 0) {
293-
this.consistent = false;
294-
}
295-
}
296-
abort = false;
297-
} finally {
298-
if (abort) {
287+
entity.writeTo(outStream);
288+
outStream.close();
289+
} catch (final ResponseOutOfOrderException ex) {
290+
if (len != 0) {
299291
this.consistent = false;
300-
close(CloseMode.IMMEDIATE);
301292
}
293+
} catch (final IOException ex) {
294+
this.consistent = false;
295+
close(CloseMode.IMMEDIATE);
296+
throw ex;
302297
}
303298
}
304299

300+
305301
@Override
306302
public boolean isConsistent() {
307303
return this.consistent;

0 commit comments

Comments
 (0)