Changeset 3737:e79803f4911d in roaraudio for roard/req.c


Ignore:
Timestamp:
04/26/10 13:55:19 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added clients_new_from_fh(), converted some code to use the function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/req.c

    r3734 r3737  
    291291 
    292292int req_on_passfh      (int client, struct roar_message * mes, char * data) { 
    293  struct roar_client * c; 
    294293 int sock = clients_get_fh(client); 
    295294 int16_t * d = (int16_t*)mes->data; 
     
    351350  lsock->proto  = d[2]; 
    352351 } else { 
    353   if ( d[2] != ROAR_PROTO_ROARAUDIO ) // protocol 
    354    return -1; 
    355  
    356   if ( d[3] != ROAR_BYTEORDER_NETWORK ) // byte order 
    357    return -1; 
    358  
    359   if ( (client = clients_new()) == -1 ) 
    360    return -1; 
    361  
    362   if ( clients_set_fh(client, fh) == -1 ) { 
    363    clients_delete(client); 
    364    return -1; 
    365   } 
    366  
    367   if ( clients_get(client, &c) != -1 ) { 
    368    roar_nnode_new_from_fh(&(c->nnode), fh, 1); 
    369   } 
     352  if ( clients_new_from_fh(fh, d[2], d[3], 1) == -1 ) 
     353   return -1; 
    370354 } 
    371355 
Note: See TracChangeset for help on using the changeset viewer.