@@ -753,10 +753,10 @@ namespace nvhttp {
753753 }
754754 tree.put (" root.ServerCodecModeSupport" , codec_mode_flags);
755755
756- auto current_appid = proc::proc.running ();
756+ auto current_appid = proc::proc.get_running_app_id ();
757757 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" );
760760
761761 std::ostringstream data;
762762
@@ -837,10 +837,7 @@ namespace nvhttp {
837837 return ;
838838 }
839839
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 ()) {
844841 tree.put (" root.resume" , 0 );
845842 tree.put (" root.<xmlattr>.status_code" , 400 );
846843 tree.put (" root.<xmlattr>.status_message" , " An app is already running on this host" );
@@ -884,6 +881,7 @@ namespace nvhttp {
884881 return ;
885882 }
886883
884+ auto appid = util::from_view (get_arg (args, " appid" ));
887885 if (appid > 0 ) {
888886 auto err = proc::proc.execute (appid, launch_session);
889887 if (err) {
@@ -917,8 +915,7 @@ namespace nvhttp {
917915 response->close_connection_after_response = true ;
918916 });
919917
920- auto current_appid = proc::proc.running ();
921- if (current_appid == 0 ) {
918+ if (!proc::proc.get_running_app_id ()) {
922919 tree.put (" root.resume" , 0 );
923920 tree.put (" root.<xmlattr>.status_code" , 503 );
924921 tree.put (" root.<xmlattr>.status_message" , " No running app to resume" );
@@ -1000,12 +997,9 @@ namespace nvhttp {
1000997 tree.put (" root.<xmlattr>.status_code" , 200 );
1001998
1002999 rtsp_stream::terminate_sessions ();
1000+ proc::proc.terminate ();
10031001
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.
10091003 display_device::revert_configuration ();
10101004 }
10111005
0 commit comments