sanityCheck function
Implementation
bool sanityCheck(IncomingMessage m, PitelUA u, Transport t) {
message = m;
ua = u;
transport = t;
for (bool Function() check in all) {
if (check() == false) {
return false;
}
}
if (message is IncomingRequest) {
for (bool Function() check in requests) {
if (check() == false) {
return false;
}
}
} else if (message is IncomingResponse) {
for (bool Function() check in responses) {
if (check() == false) {
return false;
}
}
}
// Everything is OK.
return true;
}