Changeset 490:dc9ab0d247dc in roaraudio for roard/req.c


Ignore:
Timestamp:
08/14/08 05:02:17 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

corrected a cast and moved SO_PEERCRED code from req.c to network.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/req.c

    r486 r490  
    1212 struct roar_client * c; 
    1313 int max_len; 
    14 #ifdef SO_PEERCRED 
    15  struct ucred cred; 
    16  socklen_t cred_len = sizeof(cred); 
    17 #endif 
    1814 
    1915 if ( mes->datalen < 1 ) 
     
    2319 
    2420 if ( mes->data[0] == 1 ) { 
    25 #ifdef SO_PEERCRED 
    26   if (getsockopt(c->fh, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len) != -1) { 
    27    if ( cred.pid != 0 ) { 
    28     c->pid = cred.pid; 
    29     c->uid = cred.uid; 
    30     c->gid = cred.gid; 
    31    } 
    32   } else { 
    33    ROAR_DBG("req_on_identify(): Can't get creds via SO_PEERCRED: %s", strerror(errno)); 
    34   } 
    35 #endif 
    3621  if ( c->pid == -1 ) { 
    3722   c->pid       = ROAR_NET2HOST32(*(uint32_t*)((mes->data)+1)); 
     
    420405 } 
    421406 
    422  if ( streams_get(mes->stream, ROAR_STREAM_SERVER(&s)) == -1 ) { 
     407 if ( streams_get(mes->stream, (struct roar_stream_server **)&s) == -1 ) { 
    423408  ROAR_WARN("req_on_get_stream_para(*): request on non existing (or other error?) stream %i", mes->stream); 
    424409  return -1; 
Note: See TracChangeset for help on using the changeset viewer.