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