This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 3425355 Refactor. Narrow scope of try block.
3425355 is described below
commit 34253559f6da3a32fc99e1fd13fcf6c5b853baac
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Apr 30 17:20:11 2019 +0100
Refactor. Narrow scope of try block.
---
java/org/apache/coyote/http2/Stream.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/java/org/apache/coyote/http2/Stream.java
b/java/org/apache/coyote/http2/Stream.java
index 065f07b..1c6ed9d 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -270,8 +270,8 @@ public class Stream extends AbstractStream implements
HeaderEmitter {
throw new CloseNowException(sm.getString("stream.notWritable",
getConnectionId(), getIdentifier()));
}
- try {
- if (block) {
+ if (block) {
+ try {
long writeTimeout =
handler.getProtocol().getStreamWriteTimeout();
if (writeTimeout < 0) {
wait();
@@ -292,14 +292,14 @@ public class Stream extends AbstractStream implements
HeaderEmitter {
streamOutputBuffer.reset = se;
throw new CloseNowException(msg, se);
}
- } else {
- return 0;
+ } catch (InterruptedException e) {
+ // Possible shutdown / rst or similar. Use an IOException
to
+ // signal to the client that further I/O isn't possible
for this
+ // Stream.
+ throw new IOException(e);
}
- } catch (InterruptedException e) {
- // Possible shutdown / rst or similar. Use an IOException to
- // signal to the client that further I/O isn't possible for
this
- // Stream.
- throw new IOException(e);
+ } else {
+ return 0;
}
}
int allocation;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]