Changeset 4683:9d58aba09f3e in roaraudio
- Timestamp:
- 12/22/10 02:59:45 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/clients.c
r4679 r4683 26 26 #include "roard.h" 27 27 28 struct roard_proto g_proto[ 8] = {28 struct roard_proto g_proto[MAX_PROTOS] = { 29 29 #ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD 30 30 #ifdef ROAR_HAVE_H_ESD 31 {ROAR_PROTO_ESOUND, emul_esd_check_client},31 {ROAR_PROTO_ESOUND, NULL, emul_esd_check_client}, 32 32 #endif 33 33 #endif 34 34 #ifndef ROAR_WITHOUT_DCOMP_EMUL_RPLAY 35 {ROAR_PROTO_RPLAY, emul_rplay_check_client},35 {ROAR_PROTO_RPLAY, NULL, emul_rplay_check_client}, 36 36 #endif 37 37 {-1, NULL} -
roard/include/client.h
r4679 r4683 69 69 } * g_clients[ROAR_CLIENTS_MAX]; 70 70 71 struct roard_listen; 72 71 73 struct roard_proto { 72 74 int proto; 75 int (*new_client)(int client, struct roar_vio_calls * vio, struct roard_listen * lsock); 73 76 int (*check_client)(int client, struct roar_vio_calls * vio); 74 77 }; 78 79 #define MAX_PROTOS 8 80 struct roard_proto g_proto[MAX_PROTOS]; 75 81 76 82 // basic functions -
roard/network.c
r4228 r4683 77 77 struct sockaddr_storage addr; 78 78 socklen_t addrlen = sizeof(addr); 79 size_t i; 80 int supported = 0; 79 81 80 82 if ( roar_vio_ctl(&(lsock->sock), ROAR_VIO_CTL_GET_FH, &socket) == -1 ) { … … 188 190 if ( roar_vio_open_fh_socket(&vio, fh) == -1 ) 189 191 return -1; 190 roar_vio_close(&vio); 191 return -1; 192 193 for (i = 0; g_proto[i].proto != -1; i++) { 194 printf("g_proto[i=%i].proto=%i, lsock->proto=%i\n", (int)i, g_proto[i].proto, lsock->proto); 195 if ( g_proto[i].proto == lsock->proto ) { 196 supported = 1; 197 if ( g_proto[i].new_client != NULL ) { 198 if ( g_proto[i].new_client(client, &vio, lsock) == -1 ) { 199 supported = 0; 200 } 201 } 202 } 203 } 204 205 if ( !supported ) { 206 clients_delete(client); 207 //roar_vio_close(&vio); 208 return -1; 209 } 192 210 break; 193 211 }
Note: See TracChangeset
for help on using the changeset viewer.