Skip to content

Commit b3a2d1f

Browse files
author
pfeatherstone
committed
moved websocket_frame to implementation details
1 parent 02df0c3 commit b3a2d1f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/http.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,21 @@ namespace http
14011401
serialize_header_final(resp, status_str, buf);
14021402
}
14031403

1404+
//----------------------------------------------------------------------------------------------------------------
1405+
1406+
struct websocket_frame
1407+
{
1408+
unsigned char opcode : 4;
1409+
unsigned char rsv3 : 1;
1410+
unsigned char rsv2 : 1;
1411+
unsigned char rsv1 : 1;
1412+
unsigned char fin : 1;
1413+
unsigned char paylen : 7;
1414+
unsigned char masked : 1;
1415+
};
1416+
1417+
static_assert(sizeof(websocket_frame) == 2, "bad");
1418+
14041419
//----------------------------------------------------------------------------------------------------------------
14051420

14061421
bool websocket_parser::parse(std::vector<char>& msg, std::string& buf, std::error_code& ec)

src/http.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -605,21 +605,6 @@ namespace http
605605
WS_OPCODE_PONG = 10
606606
};
607607

608-
//----------------------------------------------------------------------------------------------------------------
609-
610-
struct websocket_frame
611-
{
612-
unsigned char opcode : 4;
613-
unsigned char rsv3 : 1;
614-
unsigned char rsv2 : 1;
615-
unsigned char rsv1 : 1;
616-
unsigned char fin : 1;
617-
unsigned char paylen : 7;
618-
unsigned char masked : 1;
619-
};
620-
621-
static_assert(sizeof(websocket_frame) == 2, "bad");
622-
623608
//----------------------------------------------------------------------------------------------------------------
624609

625610
class websocket_parser

0 commit comments

Comments
 (0)