code:     protected int readMessage(AjpMessage message, boolean blockFirstRead)
          throws IOException {
  
          byte[] buf = message.getBuffer();
          int headerLength = message.getHeaderLength();
  
          int bytesRead = read(buf, 0, headerLength, blockFirstRead);
  
          if (bytesRead == 0) {
              return 0;
          }
          
          int messageLength = message.processHeader(true);
          if (messageLength < 0) {
              // Invalid AJP header signature
              throw new IOException(sm.getString("ajpmessage.invalidLength",
                      Integer.valueOf(messageLength)));
          }
          else if (messageLength == 0) {
              // Zero length message.
              return bytesRead;
          }
          else {
              if (messageLength > buf.length) {
                  // Message too long for the buffer
                  // Need to trigger a 400 response
                  throw new IllegalArgumentException(sm.getString(
                          "ajpprocessor.header.tooLong",
                          Integer.valueOf(messageLength),
                          Integer.valueOf(buf.length)));
              }
              bytesRead += read(buf, headerLength, messageLength, true);
              return bytesRead;
          }
      }
  
  
  