< prev index next >

src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -549,13 +549,15 @@
                 }
                 Request req = new Request (rawin, rawout);
                 requestLine = req.requestLine();
                 if (requestLine == null) {
                     /* connection closed */
+                    logger.log(Level.DEBUG, "no request line: closing");
                     closeConnection(connection);
                     return;
                 }
+                logger.log(Level.DEBUG, "Exchange request line: {0}", requestLine);
                 int space = requestLine.indexOf (' ');
                 if (space == -1) {
                     reject (Code.HTTP_BAD_REQUEST,
                             requestLine, "Bad request line");
                     return;

@@ -795,20 +797,22 @@
     // quickly enough. It then starts the timer
     // that ensures the client reads the response in a timely
     // fashion.
 
     void requestCompleted (HttpConnection c) {
-        assert c.getState() == State.REQUEST;
+        State s = c.getState();
+        assert s == State.REQUEST : "State is not REQUEST ("+s+")";
         reqConnections.remove (c);
         c.rspStartedTime = getTime();
         rspConnections.add (c);
         c.setState (State.RESPONSE);
     }
 
     // called after response has been sent
     void responseCompleted (HttpConnection c) {
-        assert c.getState() == State.RESPONSE;
+        State s = c.getState();
+        assert s == State.RESPONSE : "State is not RESPONSE ("+s+")";
         rspConnections.remove (c);
         c.setState (State.IDLE);
     }
 
     /**
< prev index next >