mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-12-02 00:12:33 +08:00
websocket协议支持随机掩码
This commit is contained in:
parent
c20a1337a5
commit
07089ea4e2
@ -44,7 +44,12 @@ public:
|
|||||||
CONTROL_RSVF = 0xF
|
CONTROL_RSVF = 0xF
|
||||||
} Type;
|
} Type;
|
||||||
public:
|
public:
|
||||||
WebSocketHeader() : _mask(4){}
|
WebSocketHeader() : _mask(4){
|
||||||
|
//获取_mask内部buffer的内存地址,该内存是malloc开辟的,地址为随机
|
||||||
|
uint64_t ptr = (uint64_t)(&_mask[0]);
|
||||||
|
//根据内存地址设置掩码随机数
|
||||||
|
_mask.assign((uint8_t*)(&ptr), (uint8_t*)(&ptr) + 4);
|
||||||
|
}
|
||||||
virtual ~WebSocketHeader(){}
|
virtual ~WebSocketHeader(){}
|
||||||
public:
|
public:
|
||||||
bool _fin;
|
bool _fin;
|
||||||
|
Loading…
Reference in New Issue
Block a user