File tree Expand file tree Collapse file tree 7 files changed +11
-5
lines changed Expand file tree Collapse file tree 7 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ namespace Comms{
17
17
uint8_t sessionUnspecifiedMode = 0 ;
18
18
uint8_t sessionStreamInfoMode = SESS_DEFAULT_STREAM_INFO_MODE;
19
19
uint8_t tknMode = SESS_TKN_DEFAULT_MODE;
20
+ uint8_t defaultCommFlags = 0 ;
20
21
21
22
// / \brief Refreshes the session configuration if the last update was more than 5 seconds ago
22
23
void sessionConfigCache (){
@@ -103,7 +104,7 @@ namespace Comms{
103
104
for (size_t i = 0 ; i < recordCount (); i++){
104
105
if (getStatus (i) == COMM_STATUS_INVALID || (getStatus (i) & COMM_STATUS_DISCONNECT)){continue ;}
105
106
uint64_t cPid = getPid (i);
106
- if (cPid > 1 ){
107
+ if (cPid > 1 && !( getStatus (i) & COMM_STATUS_NOKILL) ){
107
108
Util::Procs::Stop (cPid); // soft kill
108
109
keepGoing = true ;
109
110
}
@@ -164,7 +165,7 @@ namespace Comms{
164
165
IPC::semGuard G (&sem);
165
166
if (getStatus () != COMM_STATUS_INVALID){continue ;}
166
167
nullFields ();
167
- setStatus (COMM_STATUS_ACTIVE);
168
+ setStatus (COMM_STATUS_ACTIVE | defaultCommFlags );
168
169
break ;
169
170
}
170
171
}
@@ -275,7 +276,7 @@ namespace Comms{
275
276
if (dataPage){
276
277
setTrack (idx);
277
278
setKeyNum (0 );
278
- setStatus (initialState);
279
+ setStatus (initialState | defaultCommFlags );
279
280
}
280
281
}
281
282
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ namespace Comms{
26
26
extern uint8_t sessionUnspecifiedMode;
27
27
extern uint8_t sessionStreamInfoMode;
28
28
extern uint8_t tknMode;
29
+ extern uint8_t defaultCommFlags;
29
30
void sessionConfigCache ();
30
31
31
32
class Comms {
Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ static inline void show_stackframe(){}
291
291
#define COMM_STATUS_DONOTTRACK 0x40
292
292
#define COMM_STATUS_DISCONNECT 0x20
293
293
#define COMM_STATUS_REQDISCONNECT 0x10
294
+ #define COMM_STATUS_NOKILL 0x8
294
295
#define COMM_STATUS_ACTIVE 0x1
295
296
#define COMM_STATUS_INVALID 0x0
296
297
#define SESS_BUNDLE_DEFAULT_VIEWER 14
Original file line number Diff line number Diff line change @@ -2221,7 +2221,7 @@ namespace Mist{
2221
2221
onFail (" Shutting down since this session is not allowed to view this stream" );
2222
2222
statComm.unload ();
2223
2223
return ;
2224
- }
2224
+ }
2225
2225
2226
2226
lastStats = now;
2227
2227
Original file line number Diff line number Diff line change @@ -446,6 +446,7 @@ int main(int argc, char *argv[]){
446
446
sigaction (SIGUSR1, &new_action, NULL );
447
447
}
448
448
if (conf.getInteger (" port" ) && conf.getString (" interface" ).size ()){
449
+ Comms::defaultCommFlags = COMM_STATUS_NOKILL;
449
450
450
451
if (rist_receiver_create (&rec_ctx, (rist_profile)conf.getInteger (" profile" ), &Mist::log_settings) != 0 ){
451
452
FAIL_MSG (" Failed to create receiver context" );
Original file line number Diff line number Diff line change @@ -501,6 +501,7 @@ int main(int argc, char *argv[]){
501
501
if (oldSignal){WARN_MSG (" Multiple signal handlers! I can't deal with this." );}
502
502
oldSignal = cur_action.sa_sigaction ;
503
503
}
504
+ Comms::defaultCommFlags = COMM_STATUS_NOKILL;
504
505
Util::Procs::socketList.insert (server_socket.getSocket ());
505
506
while (conf.is_active && server_socket.connected ()){
506
507
Socket::SRTConnection S = server_socket.accept (false , " output" );
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ int main(int argc, char **argv){
141
141
cleanUsers.setStatus (COMM_STATUS_INVALID, i);
142
142
if (status != COMM_STATUS_INVALID && !(status & COMM_STATUS_DISCONNECT)){
143
143
pid_t pid = cleanUsers.getPid (i);
144
- if (pid > 1 ){
144
+ if (pid > 1 && !(cleanUsers. getStatus (i) & COMM_STATUS_NOKILL) ){
145
145
Util::Procs::Stop (pid);
146
146
checkPids.insert (pid);
147
147
}
@@ -165,3 +165,4 @@ int main(int argc, char **argv){
165
165
nukeSem (" /MstPull_%s" );
166
166
nukeSem (SEM_TRACKLIST);
167
167
}
168
+
You can’t perform that action at this time.
0 commit comments