Changeset 66:a75c2005faeb in roaraudio
- Timestamp:
- 07/12/08 13:38:56 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/clients.c
r0 r66 111 111 struct timeval tv; 112 112 fd_set r, e; 113 int i ;113 int i, j; 114 114 int ret; 115 115 int fh; … … 126 126 continue; 127 127 128 if ( (fh = g_clients[i]->fh) == -1 ) 129 continue; 130 131 FD_SET(fh, &r); 132 FD_SET(fh, &e); 133 134 if ( fh > max_fh ) 135 max_fh = fh; 128 if ( (fh = g_clients[i]->fh) != -1 ) { 129 FD_SET(fh, &r); 130 FD_SET(fh, &e); 131 132 if ( fh > max_fh ) 133 max_fh = fh; 134 } else { 135 136 for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 137 if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 138 FD_SET(fh, &r); 139 140 if ( fh > max_fh ) 141 max_fh = fh; 142 } 143 } 144 } 145 136 146 } 137 147 … … 144 154 continue; 145 155 146 if ( (fh = g_clients[i]->fh) == -1 ) 147 continue; 148 149 if ( FD_ISSET(fh, &r) ) { 150 if ( g_clients[i]->execed == -1 ) { 151 clients_check(i); 152 } else { 153 streams_check(g_clients[i]->execed); 154 } 155 } 156 157 if ( FD_ISSET(fh, &e) ) 158 clients_delete(i); 156 if ( (fh = g_clients[i]->fh) != -1 ) { 157 158 if ( FD_ISSET(fh, &r) ) { 159 if ( g_clients[i]->execed == -1 ) { 160 clients_check(i); 161 } else { 162 streams_check(g_clients[i]->execed); 163 } 164 } 165 166 if ( FD_ISSET(fh, &e) ) 167 clients_delete(i); 168 } else { 169 for (j = 0; j < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; j++) { 170 if ( (fh = streams_get_fh(g_clients[i]->streams[j])) != -1 ) { 171 if ( FD_ISSET(fh, &r) ) { 172 streams_check(g_clients[i]->streams[j]); 173 } 174 } 175 } 176 } 159 177 } 160 178 -
roard/include/streams.h
r21 r66 34 34 35 35 int streams_set_fh (int id, int fh); 36 int streams_get_fh (int id); 36 37 int streams_get (int id, struct roar_stream_server ** stream); 37 38 -
roard/streams.c
r53 r66 121 121 } 122 122 123 int streams_get_fh (int id) { 124 if ( g_streams[id] == NULL ) 125 return -1; 126 127 return ((struct roar_stream *)g_streams[id])->fh; 128 } 123 129 124 130 int streams_get (int id, struct roar_stream_server ** stream) {
Note: See TracChangeset
for help on using the changeset viewer.