diff options
author | Jo Shields <directhex@apebox.org> | 2014-02-19 22:12:43 +0000 |
---|---|---|
committer | Jo Shields <directhex@apebox.org> | 2014-02-19 22:12:43 +0000 |
commit | 9972bf87b4f27d9c8f358ef8414ac1ab957a2f0f (patch) | |
tree | 5bb230c1d698659115f918e243c1d4b0aa4c7f51 /external/ikvm/openjdk/java/net/SocketInputStream.java | |
parent | d0a215f5626219ff7927f576588a777e5331c7be (diff) | |
download | mono-upstream/3.2.8+dfsg.tar.gz |
Imported Upstream version 3.2.8+dfsgupstream/3.2.8+dfsg
Diffstat (limited to 'external/ikvm/openjdk/java/net/SocketInputStream.java')
-rw-r--r-- | external/ikvm/openjdk/java/net/SocketInputStream.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/external/ikvm/openjdk/java/net/SocketInputStream.java b/external/ikvm/openjdk/java/net/SocketInputStream.java index 830fa51ce1..161947cc5e 100644 --- a/external/ikvm/openjdk/java/net/SocketInputStream.java +++ b/external/ikvm/openjdk/java/net/SocketInputStream.java @@ -32,6 +32,7 @@ import java.nio.channels.FileChannel; import static ikvm.internal.Winsock.*; import static java.net.net_util_md.*; +import sun.misc.IoTrace; import sun.net.ConnectionResetException; /** @@ -41,7 +42,6 @@ import sun.net.ConnectionResetException; * * @author Jonathan Payne * @author Arthur van Hoff - * @author Jeroen Frijters */ class SocketInputStream extends FileInputStream { @@ -182,7 +182,7 @@ class SocketInputStream extends FileInputStream } int read(byte b[], int off, int length, int timeout) throws IOException { - int n; + int n = 0; // EOF already encountered if (eof) { @@ -204,6 +204,7 @@ class SocketInputStream extends FileInputStream boolean gotReset = false; + Object traceContext = IoTrace.socketReadBegin(); // acquire file descriptor and do the read FileDescriptor fd = impl.acquireFD(); try { @@ -215,6 +216,8 @@ class SocketInputStream extends FileInputStream gotReset = true; } finally { impl.releaseFD(); + IoTrace.socketReadEnd(traceContext, impl.address, impl.port, + timeout, n > 0 ? n : 0); } /* @@ -222,6 +225,7 @@ class SocketInputStream extends FileInputStream * buffered on the socket */ if (gotReset) { + traceContext = IoTrace.socketReadBegin(); impl.setConnectionResetPending(); impl.acquireFD(); try { @@ -232,6 +236,8 @@ class SocketInputStream extends FileInputStream } catch (ConnectionResetException rstExc) { } finally { impl.releaseFD(); + IoTrace.socketReadEnd(traceContext, impl.address, impl.port, + timeout, n > 0 ? n : 0); } } |