networking · intermediate · ~15 min
Read the big-endian record length.
The TLS record length is the big-endian 16-bit value at offset 3. Implement int tls_record_length(const unsigned char *rec) returning it.
int tls_record_length(const unsigned char *rec) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.