795 // quickly enough. It then starts the timer |
795 // quickly enough. It then starts the timer |
796 // that ensures the client reads the response in a timely |
796 // that ensures the client reads the response in a timely |
797 // fashion. |
797 // fashion. |
798 |
798 |
799 void requestCompleted (HttpConnection c) { |
799 void requestCompleted (HttpConnection c) { |
800 assert c.getState() == State.REQUEST; |
800 State s = c.getState(); |
|
801 assert s == State.REQUEST : "State is not REQUEST ("+s+")"; |
801 reqConnections.remove (c); |
802 reqConnections.remove (c); |
802 c.rspStartedTime = getTime(); |
803 c.rspStartedTime = getTime(); |
803 rspConnections.add (c); |
804 rspConnections.add (c); |
804 c.setState (State.RESPONSE); |
805 c.setState (State.RESPONSE); |
805 } |
806 } |
806 |
807 |
807 // called after response has been sent |
808 // called after response has been sent |
808 void responseCompleted (HttpConnection c) { |
809 void responseCompleted (HttpConnection c) { |
809 assert c.getState() == State.RESPONSE; |
810 State s = c.getState(); |
|
811 assert s == State.RESPONSE : "State is not RESPONSE ("+s+")"; |
810 rspConnections.remove (c); |
812 rspConnections.remove (c); |
811 c.setState (State.IDLE); |
813 c.setState (State.IDLE); |
812 } |
814 } |
813 |
815 |
814 /** |
816 /** |