diff --git a/jdk/src/share/classes/sun/net/httpserver/Request.java b/jdk/src/share/classes/sun/net/httpserver/Request.java index bdafe663c1b..02d240c989c 100644 --- a/jdk/src/share/classes/sun/net/httpserver/Request.java +++ b/jdk/src/share/classes/sun/net/httpserver/Request.java @@ -52,6 +52,9 @@ class Request { os = rawout; do { startLine = readLine(); + if (startLine == null) { + return; + } /* skip blank lines */ } while (startLine.equals ("")); } diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java index 104bdb0180b..919f7ce8ab6 100644 --- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java +++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java @@ -441,6 +441,7 @@ class ServerImpl implements TimeSource { rawin = sslStreams.getInputStream(); rawout = sslStreams.getOutputStream(); engine = sslStreams.getSSLEngine(); + connection.sslStreams = sslStreams; } else { rawin = new BufferedInputStream( new Request.ReadStream ( @@ -450,6 +451,8 @@ class ServerImpl implements TimeSource { ServerImpl.this, chan ); } + connection.raw = rawin; + connection.rawout = rawout; } Request req = new Request (rawin, rawout); requestLine = req.requestLine();