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

Method connect

Libraries/Http/HttpWebSocket.cpp:578–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576void HttpWebSocketTransportView::reset()
577{
578 readableStream = nullptr;
579 writableStream = nullptr;
580 buffersPool = nullptr;
581}
582
583Result HttpWebSocketHandshake::createClientKey(Span<const uint8_t> nonce, Span<char> storage, StringSpan& key)
584{
585 SC_TRY_MSG(nonce.sizeInBytes() == NonceLength, "HttpWebSocketHandshake nonce must be 16 bytes");
586 return scHttpWebSocketBase64Encode(nonce, storage, key);
587}
588
589Result HttpWebSocketHandshake::validateClientKey(StringSpan key)
590{
591 SC_TRY_MSG(key.sizeInBytes() == ClientKeyLength, "HttpWebSocketHandshake Sec-WebSocket-Key length invalid");
592
593 uint8_t decoded[NonceLength] = {0};
594 size_t decodedBytes = 0;

Callers

nothing calls this directly

Calls 2

resetMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected