Skip to content

Commit

Permalink
ws{,s}_{client,server}_session: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Jun 11, 2024
1 parent 2d572ca commit 88f5050
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions poseidon/socket/ws_client_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ do_on_http_upgraded_stream(linear_buffer& data, bool eof)

// Get the status code in big-endian order..
uint16_t bestatus;
WebSocket_Status status = websocket_status_no_status_code;
if(payload.getn(reinterpret_cast<char*>(&bestatus), 2) >= 2)
this->do_on_ws_close(static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus)), payload);
else
this->do_on_ws_close(websocket_status_no_status_code, payload);
status = static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus));
this->do_on_ws_close(status, payload);
}
return;

Expand Down
6 changes: 3 additions & 3 deletions poseidon/socket/ws_server_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ do_on_http_upgraded_stream(linear_buffer& data, bool eof)

// Get the status code in big-endian order..
uint16_t bestatus;
WebSocket_Status status = websocket_status_no_status_code;
if(payload.getn(reinterpret_cast<char*>(&bestatus), 2) >= 2)
this->do_on_ws_close(static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus)), payload);
else
this->do_on_ws_close(websocket_status_no_status_code, payload);
status = static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus));
this->do_on_ws_close(status, payload);
}
return;

Expand Down
6 changes: 3 additions & 3 deletions poseidon/socket/wss_client_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ do_on_http_upgraded_stream(linear_buffer& data, bool eof)

// Get the status code in big-endian order..
uint16_t bestatus;
WebSocket_Status status = websocket_status_no_status_code;
if(payload.getn(reinterpret_cast<char*>(&bestatus), 2) >= 2)
this->do_on_ws_close(static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus)), payload);
else
this->do_on_ws_close(websocket_status_no_status_code, payload);
status = static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus));
this->do_on_ws_close(status, payload);
}
return;

Expand Down
6 changes: 3 additions & 3 deletions poseidon/socket/wss_server_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ do_on_http_upgraded_stream(linear_buffer& data, bool eof)

// Get the status code in big-endian order..
uint16_t bestatus;
WebSocket_Status status = websocket_status_no_status_code;
if(payload.getn(reinterpret_cast<char*>(&bestatus), 2) >= 2)
this->do_on_ws_close(static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus)), payload);
else
this->do_on_ws_close(websocket_status_no_status_code, payload);
status = static_cast<WebSocket_Status>(ROCKET_BETOH16(bestatus));
this->do_on_ws_close(status, payload);
}
return;

Expand Down

0 comments on commit 88f5050

Please sign in to comment.