comparison src/org/eclipse/jetty/server/BlockingHttpConnection.java @ 965:866f2e801618

handle() returns void
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 14 Oct 2016 02:19:21 -0600
parents fe461f7cfc8e
children 5ee36654b383
comparison
equal deleted inserted replaced
964:768414c16e10 965:866f2e801618
51 protected void handleRequest() throws IOException 51 protected void handleRequest() throws IOException
52 { 52 {
53 super.handleRequest(); 53 super.handleRequest();
54 } 54 }
55 55
56 public Connection handle() throws IOException 56 @Override
57 public void handle() throws IOException
57 { 58 {
58 Connection connection = this;
59
60 try 59 try
61 { 60 {
62 setCurrentConnection(this); 61 setCurrentConnection(this);
63 62
64 // do while the endpoint is open 63 // do while the endpoint is open
65 // AND the connection has not changed 64 // AND the connection has not changed
66 while (_endp.isOpen() && connection==this) 65 while (_endp.isOpen())
67 { 66 {
68 try 67 try
69 { 68 {
70 // If we are not ended then parse available 69 // If we are not ended then parse available
71 if (!_parser.isComplete() && !_endp.isInputShutdown()) 70 if (!_parser.isComplete() && !_endp.isInputShutdown())
99 if (_parser.isComplete() && _generator.isComplete()) 98 if (_parser.isComplete() && _generator.isComplete())
100 { 99 {
101 // Reset the parser/generator 100 // Reset the parser/generator
102 reset(); 101 reset();
103 102
104 // look for a switched connection instance?
105 if (_response.getStatus()==HttpStatus.SWITCHING_PROTOCOLS_101)
106 {
107 Connection switched=(Connection)_request.getAttribute("org.eclipse.jetty.io.Connection");
108 if (switched!=null)
109 connection=switched;
110 }
111
112 // TODO Is this required? 103 // TODO Is this required?
113 if (!_generator.isPersistent() && !_endp.isOutputShutdown()) 104 if (!_generator.isPersistent() && !_endp.isOutputShutdown())
114 { 105 {
115 LOG.warn("Safety net oshut!!! Please open a bugzilla"); 106 LOG.warn("Safety net oshut!!! Please open a bugzilla");
116 _endp.shutdownOutput(); 107 _endp.shutdownOutput();
123 // then no more can happen, so close. 114 // then no more can happen, so close.
124 _endp.close(); 115 _endp.close();
125 } 116 }
126 } 117 }
127 } 118 }
128
129 return connection;
130 } 119 }
131 finally 120 finally
132 { 121 {
133 setCurrentConnection(null); 122 setCurrentConnection(null);
134 _parser.returnBuffers(); 123 _parser.returnBuffers();