Read an AJP body message. Used to read both the 'special' packet in ajp13 and to receive the data after we send a GET_BODY packet. @param block If there is no data available to read when this method is called, should this call block until data becomes available? @return true
(boolean block)
| 524 | * @return <code>true</code> if at least one body byte was read, otherwise <code>false</code> |
| 525 | */ |
| 526 | private boolean receive(boolean block) throws IOException { |
| 527 | |
| 528 | bodyMessage.reset(); |
| 529 | |
| 530 | if (!readMessage(bodyMessage, block)) { |
| 531 | return false; |
| 532 | } |
| 533 | |
| 534 | waitingForBodyMessage = false; |
| 535 | |
| 536 | // No data received. |
| 537 | if (bodyMessage.getLen() == 0) { |
| 538 | // just the header |
| 539 | return false; |
| 540 | } |
| 541 | int blen = bodyMessage.peekInt(); |
| 542 | if (blen == 0) { |
| 543 | return false; |
| 544 | } |
| 545 | |
| 546 | bodyMessage.getBodyBytes(bodyBytes); |
| 547 | empty = false; |
| 548 | return true; |
| 549 | } |
| 550 | |
| 551 | |
| 552 | /** |
no test coverage detected