Changeset 2014:6646d9a2113a in roaraudio
- Timestamp:
- 06/16/09 13:26:54 (15 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/roarslp.h
r2012 r2014 74 74 int roar_slp_cookie_init (struct roar_slp_cookie * cookie, struct roar_slp_search * search); 75 75 76 char * roar_slp_find_roard ( void);77 int roar_slp_find_roard_r (char * addr, size_t len );76 char * roar_slp_find_roard (int nocache); 77 int roar_slp_find_roard_r (char * addr, size_t len, int nocache); 78 78 79 79 #endif -
libroar/basic.c
r2010 r2014 107 107 108 108 #ifdef ROAR_HAVE_LIBSLP 109 if ( (server = roar_slp_find_roard()) != NULL ) { 110 return roar_connect_raw(server); 111 } else { 112 return -1; 113 } 114 #endif 109 if ( (server = roar_slp_find_roard(0)) != NULL ) 110 if ( (fh = roar_connect_raw(server)) != -1 ) 111 return fh; 112 113 /* in case we can not connect to the server given this may be a cache problem, 114 we do a new lookup with the cache disabled in this case */ 115 ROAR_WARN("roar_connect_raw(*): Can not connect to SLP located server, disabling cache"); 116 if ( (server = roar_slp_find_roard(1)) != NULL ) 117 if ( (fh = roar_connect_raw(server)) != -1 ) 118 return fh; 119 #endif 120 121 return -1; 115 122 116 123 } else { -
libroar/slp.c
r2013 r2014 136 136 137 137 138 char * roar_slp_find_roard ( void) {138 char * roar_slp_find_roard (int nocache) { 139 139 static char addr[80]; 140 140 141 if ( roar_slp_find_roard_r(addr, 80 ) == -1 )141 if ( roar_slp_find_roard_r(addr, 80, nocache) == -1 ) 142 142 return NULL; 143 143 … … 145 145 } 146 146 147 int roar_slp_find_roard_r (char * addr, size_t len ) {147 int roar_slp_find_roard_r (char * addr, size_t len, int nocache) { 148 148 static struct roar_slp_match cache = {"", 0}; 149 149 struct roar_slp_cookie cookie; … … 158 158 *addr = 0; // just in case... 159 159 160 if ( cache.tod < time(NULL) ) { 160 if ( nocache || cache.tod < time(NULL) ) { 161 if ( nocache ) { 162 ROAR_WARN("roar_slp_find_roard_r(*): forced ignoring of cache, doing a new lookup."); 163 } 161 164 ROAR_WARN("roar_slp_find_roard_r(*): cache too old, searching for a new server..."); 162 165 ROAR_DBG("roar_slp_find_roard_r(*) = ?");
Note: See TracChangeset
for help on using the changeset viewer.