mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr
This commit is contained in:
parent
4e6f03a860
commit
6cf59b6ae9
58 changed files with 315 additions and 469 deletions
|
@ -493,9 +493,7 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
|||
ssize_t res = 0;
|
||||
|
||||
if (buffer.size() < 3) {
|
||||
#if TLS_DEBUG
|
||||
dbgln("not enough certificate header data");
|
||||
#endif
|
||||
dbgln_if(TLS_DEBUG, "not enough certificate header data");
|
||||
return (i8)Error::NeedMoreData;
|
||||
}
|
||||
|
||||
|
@ -509,9 +507,7 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
|||
res += 3;
|
||||
|
||||
if (certificate_total_length > buffer.size() - res) {
|
||||
#if TLS_DEBUG
|
||||
dbgln("not enough data for claimed total cert length");
|
||||
#endif
|
||||
dbgln_if(TLS_DEBUG, "not enough data for claimed total cert length");
|
||||
return (i8)Error::NeedMoreData;
|
||||
}
|
||||
size_t size = certificate_total_length;
|
||||
|
@ -522,18 +518,14 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
|||
while (size > 0) {
|
||||
++index;
|
||||
if (buffer.size() - res < 3) {
|
||||
#if TLS_DEBUG
|
||||
dbgln("not enough data for certificate length");
|
||||
#endif
|
||||
dbgln_if(TLS_DEBUG, "not enough data for certificate length");
|
||||
return (i8)Error::NeedMoreData;
|
||||
}
|
||||
size_t certificate_size = buffer[res] * 0x10000 + buffer[res + 1] * 0x100 + buffer[res + 2];
|
||||
res += 3;
|
||||
|
||||
if (buffer.size() - res < certificate_size) {
|
||||
#if TLS_DEBUG
|
||||
dbgln("not enough data for certificate body");
|
||||
#endif
|
||||
dbgln_if(TLS_DEBUG, "not enough data for certificate body");
|
||||
return (i8)Error::NeedMoreData;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue