if (checkHttpChannel() == null) {
return;
}
}
IOBuffer receiveBody = activeHttp.receiveBody;
if (!headersReceived) {
headRecvBuf.wrapTo(headW);
parseMessage(activeHttp, headW);
// Part of parseMessage we can switch the protocol
if (switchedProtocol != null) {
return;
}
if (serverMode && activeHttp.httpReq.decodedUri.remaining() == 0) {
abort(activeHttp, "Invalid url");
}
headersReceived = true;
// Send header callbacks - we process any incoming data
// first, so callbacks have more info
trace("Send headers received callback " + activeHttp.httpService);
activeHttp.handleHeadersReceived(activeHttp.inMessage);
}
// any remaining data will be processed as part of the
// body - or left in the channel until endSendReceive()
if (!bodyReceived) {
// Will close receiveBody when it consummed enough
rawDataReceived(activeHttp, receiveBody, net.getIn());
// Did we process anything ?
if (receiveBody.getBufferCount() > 0) {
activeHttp.sendHandleReceivedCallback(); // callback
}
}
// Receive has marked the body as closed
if (receiveBody.isAppendClosed()) {
bodyReceived = true;
activeHttp.handleEndReceive();
}