mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
server: Fix int type of batch execution enum
This commit is contained in:
parent
e80bcad1e1
commit
403c69463a
@ -22,7 +22,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace RequestBatchExecutionType {
|
||||
enum RequestBatchExecutionType {
|
||||
enum RequestBatchExecutionType: int8_t {
|
||||
/**
|
||||
* Not a request batch.
|
||||
*
|
||||
@ -77,7 +77,7 @@ namespace RequestBatchExecutionType {
|
||||
Parallel = 2,
|
||||
};
|
||||
|
||||
inline bool IsValid(int executionType)
|
||||
inline bool IsValid(int8_t executionType)
|
||||
{
|
||||
return executionType >= None && executionType <= Parallel;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ void WebSocketServer::ProcessMessage(SessionPtr session, WebSocketServer::Proces
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t requestedExecutionType = payloadData["executionType"];
|
||||
int8_t requestedExecutionType = payloadData["executionType"];
|
||||
if (!RequestBatchExecutionType::IsValid(requestedExecutionType) || requestedExecutionType == RequestBatchExecutionType::None) {
|
||||
ret.closeCode = WebSocketCloseCode::InvalidDataFieldValue;
|
||||
ret.closeReason = "Your `executionType` has an invalid value.";
|
||||
|
Loading…
Reference in New Issue
Block a user