@@ -753,10 +753,10 @@ namespace nvhttp {
753
753
}
754
754
tree.put (" root.ServerCodecModeSupport" , codec_mode_flags);
755
755
756
- auto current_appid = proc::proc.running ();
756
+ auto current_appid = proc::proc.get_running_app_id ();
757
757
tree.put (" root.PairStatus" , pair_status);
758
- tree.put (" root.currentgame" , current_appid);
759
- tree.put (" root.state" , current_appid > 0 ? " SUNSHINE_SERVER_BUSY" : " SUNSHINE_SERVER_FREE" );
758
+ tree.put (" root.currentgame" , current_appid. value_or ( 0 ) );
759
+ tree.put (" root.state" , current_appid ? " SUNSHINE_SERVER_BUSY" : " SUNSHINE_SERVER_FREE" );
760
760
761
761
std::ostringstream data;
762
762
@@ -837,10 +837,7 @@ namespace nvhttp {
837
837
return ;
838
838
}
839
839
840
- auto appid = util::from_view (get_arg (args, " appid" ));
841
-
842
- auto current_appid = proc::proc.running ();
843
- if (current_appid > 0 ) {
840
+ if (proc::proc.get_running_app_id ()) {
844
841
tree.put (" root.resume" , 0 );
845
842
tree.put (" root.<xmlattr>.status_code" , 400 );
846
843
tree.put (" root.<xmlattr>.status_message" , " An app is already running on this host" );
@@ -884,6 +881,7 @@ namespace nvhttp {
884
881
return ;
885
882
}
886
883
884
+ auto appid = util::from_view (get_arg (args, " appid" ));
887
885
if (appid > 0 ) {
888
886
auto err = proc::proc.execute (appid, launch_session);
889
887
if (err) {
@@ -917,8 +915,7 @@ namespace nvhttp {
917
915
response->close_connection_after_response = true ;
918
916
});
919
917
920
- auto current_appid = proc::proc.running ();
921
- if (current_appid == 0 ) {
918
+ if (!proc::proc.get_running_app_id ()) {
922
919
tree.put (" root.resume" , 0 );
923
920
tree.put (" root.<xmlattr>.status_code" , 503 );
924
921
tree.put (" root.<xmlattr>.status_message" , " No running app to resume" );
@@ -1000,12 +997,9 @@ namespace nvhttp {
1000
997
tree.put (" root.<xmlattr>.status_code" , 200 );
1001
998
1002
999
rtsp_stream::terminate_sessions ();
1000
+ proc::proc.terminate ();
1003
1001
1004
- if (proc::proc.running () > 0 ) {
1005
- proc::proc.terminate ();
1006
- }
1007
-
1008
- // The config needs to be reverted regardless of whether "proc::proc.terminate()" was called or not.
1002
+ // The config needs to be reverted regardless of whether "proc::proc.terminate()" actually terminated app or not.
1009
1003
display_device::revert_configuration ();
1010
1004
}
1011
1005
0 commit comments