Process the AJP message header, validating the message signature. @param toContainer true if the message is from the web server to the container, false if from the container to the web server @return The length of the payload, or -1 if the message signature
(boolean toContainer)
| 343 | * @return The length of the payload, or -1 if the message signature is invalid |
| 344 | */ |
| 345 | public int processHeader(boolean toContainer) { |
| 346 | pos = 0; |
| 347 | int mark = getInt(); |
| 348 | len = getInt(); |
| 349 | // Verify message signature |
| 350 | if ((toContainer && mark != 0x1234) || (!toContainer && mark != 0x4142)) { |
| 351 | log.error(sm.getString("ajpmessage.invalid", "" + mark)); |
| 352 | if (log.isTraceEnabled()) { |
| 353 | dump("In"); |
| 354 | } |
| 355 | return -1; |
| 356 | } |
| 357 | if (log.isTraceEnabled()) { |
| 358 | log.trace("Received " + len + " " + buf[0]); |
| 359 | } |
| 360 | return len; |
| 361 | } |
| 362 | |
| 363 | |
| 364 | private void dump(String prefix) { |