MCPcopy Create free account
hub / github.com/apache/tomcat / readMessage

Method readMessage

test/org/apache/coyote/ajp/SimpleAjpClient.java:380–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378 * Reads a message from the server.
379 */
380 public TesterAjpMessage readMessage() throws IOException {
381
382 InputStream is = socket.getInputStream();
383
384 TesterAjpMessage message = new TesterAjpMessage(packetSize);
385
386 byte[] buf = message.getBuffer();
387
388 read(is, buf, 0, Constants.H_SIZE);
389
390 int messageLength = message.processHeader(false);
391 if (messageLength < 0) {
392 throw new IOException("Invalid AJP message length");
393 } else if (messageLength == 0) {
394 return message;
395 } else {
396 if (messageLength > buf.length) {
397 throw new IllegalArgumentException("Message too long [" + Integer.valueOf(messageLength) +
398 "] for buffer length [" + Integer.valueOf(buf.length) + "]");
399 }
400 read(is, buf, Constants.H_SIZE, messageLength);
401 return message;
402 }
403 }
404
405 protected boolean read(InputStream is, byte[] buf, int pos, int n) throws IOException {
406

Callers 11

doSnoopTestMethod · 0.95
testSecretMethod · 0.95
testKeepAliveMethod · 0.95
doTestPostMethod · 0.95
test304WithBodyMethod · 0.95
testLargeResponseMethod · 0.95
testInvalidHeaderMethod · 0.95
testNoHeadersMethod · 0.95
sendMessageMethod · 0.95
cpingMethod · 0.95

Calls 5

readMethod · 0.95
processHeaderMethod · 0.80
getInputStreamMethod · 0.65
getBufferMethod · 0.65
valueOfMethod · 0.45

Tested by

no test coverage detected