MCPcopy Index your code
hub / github.com/apache/tomcat / SocketOutputBuffer

Class SocketOutputBuffer

java/org/apache/coyote/ajp/AjpProcessor.java:1297–1337  ·  view source on GitHub ↗

This class is an output buffer which will write data to an output stream.

Source from the content-addressed store, hash-verified

1295 * This class is an output buffer which will write data to an output stream.
1296 */
1297 protected class SocketOutputBuffer implements OutputBuffer {
1298
1299 /**
1300 * Constructs a new SocketOutputBuffer.
1301 */
1302 SocketOutputBuffer() {
1303 // No-op
1304 }
1305
1306 @Override
1307 public int doWrite(ByteBuffer chunk) throws IOException {
1308
1309 if (!response.isCommitted()) {
1310 // Validate and write response headers
1311 try {
1312 prepareResponse();
1313 } catch (IOException ioe) {
1314 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, ioe);
1315 }
1316 }
1317
1318 int len = 0;
1319 if (!swallowResponse) {
1320 try {
1321 len = chunk.remaining();
1322 writeData(chunk);
1323 len -= chunk.remaining();
1324 } catch (IOException ioe) {
1325 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, ioe);
1326 // Re-throw
1327 throw ioe;
1328 }
1329 }
1330 return len;
1331 }
1332
1333 @Override
1334 public long getBytesWritten() {
1335 return bytesWritten;
1336 }
1337 }
1338}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected