Changeset 4329:4a974f9aacc3 in roaraudio


Ignore:
Timestamp:
09/09/10 22:08:51 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated check for OT in kick command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/req.c

    r4298 r4329  
    10041004int req_on_kick (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 
    10051005 uint16_t * info = (uint16_t *) mes->data; 
     1006 int is_stream = 0; 
    10061007 
    10071008 if ( mes->datalen != 4 ) 
     
    10111012 info[1] = ROAR_NET2HOST16(info[1]); 
    10121013 
    1013  if ( info[0] == ROAR_OT_CLIENT ) { 
    1014   clients_delete(info[1]); 
    1015  } else if ( info[0] == ROAR_OT_STREAM ) { 
     1014 switch (info[0]) { 
     1015  case ROAR_OT_CLIENT: 
     1016    clients_delete(info[1]); 
     1017   break; 
     1018  case ROAR_OT_STREAM: 
     1019    is_stream = 1; 
     1020   break; 
     1021  case ROAR_OT_SOURCE: 
     1022    if ( streams_get_flag(info[1], ROAR_FLAG_SOURCE) != 1 ) 
     1023     return -1; 
     1024    is_stream = 1; 
     1025   break; 
     1026  case ROAR_OT_OUTPUT: 
     1027    if ( streams_get_flag(info[1], ROAR_FLAG_OUTPUT) != 1 ) 
     1028     return -1; 
     1029    is_stream = 1; 
     1030   break; 
     1031  default: 
     1032/* TODO: those types should be handled, too: 
     1033#define ROAR_OT_SAMPLE    4 
     1034#define ROAR_OT_MIXER     6 
     1035#define ROAR_OT_BRIDGE    7 
     1036#define ROAR_OT_LISTEN    8 
     1037#define ROAR_OT_ACTION    9 
     1038#define ROAR_OT_MSGQUEUE 10 
     1039#define ROAR_OT_MSGBUS   11 
     1040*/ 
     1041    return -1; 
     1042   break; 
     1043 } 
     1044 
     1045 if ( is_stream ) { 
    10161046  if ( streams_get_flag(info[1], ROAR_FLAG_IMMUTABLE) == 1 ) 
    10171047   return -1; 
    10181048 
    10191049  streams_delete(info[1]); 
    1020  } else if ( info[0] == ROAR_OT_SOURCE ) { 
    1021   if ( streams_get_flag(info[1], ROAR_FLAG_IMMUTABLE) == 1 ) 
    1022    return -1; 
    1023  
    1024   if ( streams_get_flag(info[1], ROAR_FLAG_SOURCE) == 1 ) { 
    1025    streams_delete(info[1]); 
    1026   } else { 
    1027    return -1; 
    1028   } 
    1029  } else { 
    1030   return -1; 
    10311050 } 
    10321051 
Note: See TracChangeset for help on using the changeset viewer.