Changeset 3643:e6200d571bb8 in roaraudio


Ignore:
Timestamp:
03/12/10 02:11:40 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for abstract name space

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r3628 r3643  
    479479 int ret; 
    480480#endif 
     481#ifdef ROAR_HAVE_UNIX 
     482 int abstract = 0; 
     483#endif 
    481484#if defined(ROAR_HAVE_IPV4) || defined(ROAR_HAVE_IPV6) || defined(ROAR_HAVE_UNIX) || defined(ROAR_HAVE_IPX) 
    482485 union { 
     
    518521  } else if ( strcmp(host, "+fork") == 0 ) { 
    519522   type = ROAR_SOCKET_TYPE_FORK; 
     523  } else if ( strcmp(host, "+abstract") == 0 ) { 
     524   type = ROAR_SOCKET_TYPE_UNIX; 
     525   abstract = 1; 
    520526  } else if ( strstr(host, "::") != NULL ) { 
    521527   type = ROAR_SOCKET_TYPE_DECNET; 
     
    616622#ifdef ROAR_HAVE_UNIX 
    617623  socket_addr.un.sun_family = AF_UNIX; 
    618   strncpy(socket_addr.un.sun_path, host, sizeof(socket_addr.un.sun_path) - 1); 
     624 
     625  if ( abstract ) { 
     626   memset(socket_addr.un.sun_path, 0, sizeof(socket_addr.un.sun_path)); 
     627   snprintf(socket_addr.un.sun_path+1, sizeof(socket_addr.un.sun_path)-1, "RoarAudio/UNIX/Abstract/%i", abstract); 
     628  } else { 
     629   strncpy(socket_addr.un.sun_path, host, sizeof(socket_addr.un.sun_path) - 1); 
     630  } 
    619631 
    620632  fh = roar_socket_new_unix(); 
Note: See TracChangeset for help on using the changeset viewer.