internal void ProcessData(
ContentType protocol,
byte[] buf,
int offset,
int len)
{
/*
* Have a look at the protocol type, and add it to the correct queue.
*/
switch (protocol)
{
case ContentType.change_cipher_spec:
changeCipherSpecQueue.AddData(buf, offset, len);
ProcessChangeCipherSpec();
break;
case ContentType.alert:
alertQueue.AddData(buf, offset, len);
ProcessAlert();
break;
case ContentType.handshake:
handshakeQueue.AddData(buf, offset, len);
ProcessHandshake();
break;
case ContentType.application_data:
if (!appDataReady)
{
this.FailWithError(AlertLevel.fatal, AlertDescription.unexpected_message);
}
applicationDataQueue.AddData(buf, offset, len);
ProcessApplicationData();
break;
default:
/*
* Uh, we don't know this protocol.
*
* RFC2246 defines on page 13, that we should ignore this.
*/
break;
}
}