Changeset 200:fc109893f25a in roaraudio


Ignore:
Timestamp:
07/20/08 22:29:08 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

there a a lot cases we can close the socket, only not when it is an execed one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/codecfilter_cmd.c

    r199 r200  
    77                                             struct roar_codecfilter   * filter) { 
    88 int socks[2]; 
     9 int execed = -1; 
    910 
    1011 if ( socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1 ) { 
     
    1516  return -1; 
    1617 
    17 // we can't close the stream in case this is an execed stream of some client. 
    18 // close(((struct roar_stream*)info)->fh); 
     18 if ( info->client != -1 ) { 
     19  execed = g_clients[info->client]->execed; 
     20 
     21  if ( execed != -1 ) { 
     22   if ( g_streams[execed] == info ) { 
     23    g_clients[info->client]->fh = socks[0]; 
     24   } else { 
     25    close(((struct roar_stream*)info)->fh); 
     26   } 
     27  } else { 
     28   close(((struct roar_stream*)info)->fh); 
     29  } 
     30 } else { 
     31  close(((struct roar_stream*)info)->fh); 
     32 } 
     33 
    1934 ((struct roar_stream*)info)->fh = socks[0]; 
    2035 ((struct roar_stream*)info)->info.codec = ROAR_CODEC_DEFAULT; 
Note: See TracChangeset for help on using the changeset viewer.