MCPcopy Create free account
hub / github.com/acl-dev/acl / peek_head_masking_key

Method peek_head_masking_key

lib_acl_cpp/src/http/websocket.cpp:587–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587bool websocket::peek_head_masking_key(void)
588{
589 size_t len = peek_buf_->size();
590
591 if (len >= sizeof(unsigned)) {
592 logger_fatal("overflow, len=%ld", (long) len);
593 }
594
595 if (!client_.readn_peek(peek_buf_, sizeof(unsigned) - len, false)) {
596 return false;
597 }
598
599 assert(peek_buf_->size() == sizeof(unsigned));
600
601 memcpy(&header_.masking_key, peek_buf_->c_str(), sizeof(unsigned));
602 status_ = WS_HEAD_FINISH;
603 peek_buf_->clear();
604 return true;
605}
606
607bool websocket::peek_frame_head(void)
608{

Callers

nothing calls this directly

Calls 5

memcpyFunction · 0.85
readn_peekMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected