diff options
author | ritchie <ritchie@gmx.at> | 2015-05-10 15:04:38 +0200 |
---|---|---|
committer | ritchie <ritchie@gmx.at> | 2015-05-10 15:04:38 +0200 |
commit | 9c4e5f6d83e3a039caf3fec36372424e796e25e7 (patch) | |
tree | 70320b8ca879656be8cbcf77e07aa97f547fa976 /core | |
parent | 30fb85f55cbd8df3005e652da3781f51294baf90 (diff) | |
download | nanohttpd-9c4e5f6d83e3a039caf3fec36372424e796e25e7.tar.gz |
config and jacoco instead of cubertura
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/fi/iki/elonen/NanoHTTPD.java | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java index 06afeb9..08b64c6 100644 --- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java +++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java @@ -588,29 +588,28 @@ public abstract class NanoHTTPD { byte[] buf = new byte[HTTPSession.BUFSIZE]; this.splitbyte = 0; this.rlen = 0; - { - int read = -1; - try { - read = this.inputStream.read(buf, 0, HTTPSession.BUFSIZE); - } catch (Exception e) { - safeClose(this.inputStream); - safeClose(this.outputStream); - throw new SocketException("NanoHttpd Shutdown"); - } - if (read == -1) { - // socket was been closed - safeClose(this.inputStream); - safeClose(this.outputStream); - throw new SocketException("NanoHttpd Shutdown"); - } - while (read > 0) { - this.rlen += read; - this.splitbyte = findHeaderEnd(buf, this.rlen); - if (this.splitbyte > 0) { - break; - } - read = this.inputStream.read(buf, this.rlen, HTTPSession.BUFSIZE - this.rlen); + + int read = -1; + try { + read = this.inputStream.read(buf, 0, HTTPSession.BUFSIZE); + } catch (Exception e) { + safeClose(this.inputStream); + safeClose(this.outputStream); + throw new SocketException("NanoHttpd Shutdown"); + } + if (read == -1) { + // socket was been closed + safeClose(this.inputStream); + safeClose(this.outputStream); + throw new SocketException("NanoHttpd Shutdown"); + } + while (read > 0) { + this.rlen += read; + this.splitbyte = findHeaderEnd(buf, this.rlen); + if (this.splitbyte > 0) { + break; } + read = this.inputStream.read(buf, this.rlen, HTTPSession.BUFSIZE - this.rlen); } if (this.splitbyte < this.rlen) { @@ -1310,7 +1309,7 @@ public abstract class NanoHTTPD { /** * logger to log to. */ - private static Logger LOG = Logger.getLogger(NanoHTTPD.class.getName()); + private static final Logger LOG = Logger.getLogger(NanoHTTPD.class.getName()); /** * Creates an SSLSocketFactory for HTTPS. Pass a loaded KeyStore and an |