- if(type < SPTPS_HANDSHAKE) {
- if(!s->instate)
- return error(s, EIO, "Application record received before handshake finished");
- if(!s->receive_record(s->handle, type, s->inbuf + 3, s->reclen))
- return false;
- } else if(type == SPTPS_HANDSHAKE) {
- if(!receive_handshake(s, s->inbuf + 3, s->reclen))
- return false;
- } else {
- return error(s, EIO, "Invalid record type %d", type);
- }