Changeset 5567:6ecf012d7063 in roaraudio for roard/roard.c
- Timestamp:
- 07/16/12 17:02:17 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/roard.c
r5566 r5567 953 953 return 0; 954 954 } 955 956 static int check_listen(void) { 957 const struct roard_proto_handle * proto; 958 const char * protoname; 959 char buffer[80]; 960 size_t i, j; 961 962 for (i = 0; i < ROAR_MAX_LISTEN_SOCKETS; i++) { 963 if ( g_listen[i].used ) { 964 proto = clients_get_protohandle(g_listen[i].proto); 965 if ( proto != NULL ) 966 continue; 967 protoname = roar_proto2str(g_listen[i].proto); 968 if ( protoname == NULL ) { 969 ROAR_ERR("check_listen(void): protocol %i is unknown (protocol ID not assigned?)."); 970 } else { 971 ROAR_DBG("check_listen(void): Unknown protocol %s(%i) is used.", protoname, g_listen[i].proto); 972 snprintf(buffer, sizeof(buffer), "protocol-%s", protoname); 973 for (j = 0; buffer[j]; j++) 974 buffer[j] = tolower(buffer[j]); 975 976 ROAR_DBG("check_listen(void): Trying to load plugin \"%s\"", buffer); 977 if ( plugins_load(buffer, NULL) == -1 ) { 978 ROAR_WARN("check_listen(void): unabled to load plugin: %s: %s", buffer, roar_errorstring); 979 } 980 } 981 982 // recheck: 983 proto = clients_get_protohandle(g_listen[i].proto); 984 if ( proto == NULL ) { 985 ROAR_WARN("check_listen(void): Protocol %s(%i) is still unknown. Deleting listen socket.", protoname, g_listen[i].proto); 986 roar_vio_close(&(g_listen[i].sock)); 987 #ifdef ROAR_HAVE_UNIX 988 if ( server[i] != NULL ) 989 if ( server[i][0] == '/' ) 990 unlink(server[i]); 991 #endif 992 g_listen[i].used = 0; 993 server[i] = NULL; 994 } 995 } 996 } 997 998 return 0; 999 } 955 1000 #endif 956 1001 … … 2400 2445 } 2401 2446 2447 if ( check_listen() == -1 ) { 2448 ROAR_ERR("Can not check listen sockets. BAD."); 2449 return 1; 2450 } 2402 2451 2403 2452 // we should handle this on microcontrollers, too.
Note: See TracChangeset
for help on using the changeset viewer.