mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
WebSocketServer: Fix execution type
This commit is contained in:
parent
de1f843ce6
commit
d7887b4c32
@ -229,8 +229,8 @@ void WebSocketServer::ProcessMessage(SessionPtr session, WebSocketServer::Proces
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t executionType = payloadData["executionType"];
|
uint8_t requestedExecutionType = payloadData["executionType"];
|
||||||
if (!RequestBatchExecutionType::IsValid(executionType) || executionType == RequestBatchExecutionType::None) {
|
if (!RequestBatchExecutionType::IsValid(requestedExecutionType) || requestedExecutionType == RequestBatchExecutionType::None) {
|
||||||
if (!session->IgnoreInvalidMessages()) {
|
if (!session->IgnoreInvalidMessages()) {
|
||||||
ret.closeCode = WebSocketCloseCode::InvalidDataFieldValue;
|
ret.closeCode = WebSocketCloseCode::InvalidDataFieldValue;
|
||||||
ret.closeReason = "Your `executionType` has an invalid value.";
|
ret.closeReason = "Your `executionType` has an invalid value.";
|
||||||
@ -238,13 +238,15 @@ void WebSocketServer::ProcessMessage(SessionPtr session, WebSocketServer::Proces
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The thread pool must support 2 or more threads else parallel requests will deadlock.
|
// The thread pool must support 2 or more threads else parallel requests will deadlock.
|
||||||
if (executionType == RequestBatchExecutionType::Parallel && _threadPool.maxThreadCount() < 2) {
|
if (requestedExecutionType == RequestBatchExecutionType::Parallel && _threadPool.maxThreadCount() < 2) {
|
||||||
if (!session->IgnoreInvalidMessages()) {
|
if (!session->IgnoreInvalidMessages()) {
|
||||||
ret.closeCode = WebSocketCloseCode::UnsupportedFeature;
|
ret.closeCode = WebSocketCloseCode::UnsupportedFeature;
|
||||||
ret.closeReason = "Parallel request batch processing is not available on this system due to limited core count.";
|
ret.closeReason = "Parallel request batch processing is not available on this system due to limited core count.";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
executionType = (RequestBatchExecutionType::RequestBatchExecutionType)requestedExecutionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payloadData.contains("variables") && !payloadData["variables"].is_null()) {
|
if (payloadData.contains("variables") && !payloadData["variables"].is_null()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user