MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / validateClientResponse

Method validateClientResponse

Libraries/Http/HttpWebSocket.cpp:490–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488 ::close(mainSocket);
489 return false;
490 }
491
492 const ssize_t written = ::send(hashSocket, data.data(), data.sizeInBytes(), 0);
493 const ssize_t readBytes =
494 written == static_cast<ssize_t>(data.sizeInBytes()) ? ::recv(hashSocket, digest, 20, 0) : -1;
495 ::close(hashSocket);
496 ::close(mainSocket);
497 return readBytes == 20;
498}
499
500static bool scHttpWebSocketPlatformSha1(SC::Span<const uint8_t> data, uint8_t digest[20])
501{
502 if (scHttpWebSocketForcePlatformSha1Unavailable)
503 {
504 return false;
505 }
506 return scHttpWebSocketLibCryptoSha1(data, digest) or scHttpWebSocketAFAlgSha1(data, digest);
507}
508#else

Callers

nothing calls this directly

Calls 4

scHttpWebSocketTrimFunction · 0.85
ResultClass · 0.50
getHeaderMethod · 0.45

Tested by

no test coverage detected