Changeset 5312:27ec111dc8c5 in roaraudio for roard
- Timestamp:
- 11/30/11 01:05:41 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/clients.c
r5304 r5312 38 38 #ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD 39 39 #ifdef ROAR_HAVE_H_ESD 40 {ROAR_PROTO_ESOUND, ROAR_SUBSYS_WAVEFORM, "EsounD emulation", NULL, emul_esd_check_client, NULL, NULL},40 {ROAR_PROTO_ESOUND, ROAR_SUBSYS_WAVEFORM, "EsounD emulation", NULL, NULL, emul_esd_check_client, NULL, NULL}, 41 41 #endif 42 42 #endif 43 43 #ifndef ROAR_WITHOUT_DCOMP_EMUL_RPLAY 44 {ROAR_PROTO_RPLAY, ROAR_SUBSYS_WAVEFORM, "RPlay emulation", NULL, emul_rplay_check_client, NULL, NULL},44 {ROAR_PROTO_RPLAY, ROAR_SUBSYS_WAVEFORM, "RPlay emulation", NULL, NULL, emul_rplay_check_client, NULL, NULL}, 45 45 #endif 46 46 #ifndef ROAR_WITHOUT_DCOMP_EMUL_GOPHER 47 {ROAR_PROTO_GOPHER, ROAR_SUBSYS_WAVEFORM, "The Internet Gopher Protocol", NULL, emul_gopher_check_client, NULL, emul_gopher_flushed_client},48 #endif 49 {-1, 0, NULL, NULL, NULL, NULL, NULL }47 {ROAR_PROTO_GOPHER, ROAR_SUBSYS_WAVEFORM, "The Internet Gopher Protocol", NULL, NULL, emul_gopher_check_client, NULL, emul_gopher_flushed_client}, 48 #endif 49 {-1, 0, NULL, NULL, NULL, NULL, NULL, NULL} 50 50 }; 51 51 … … 647 647 if ( g_proto[i].proto == c->proto ) { 648 648 roar_vio_open_fh_socket(&vio, clients_get_fh(id)); 649 if ( g_proto[i].lhandle != NULL ) 650 roar_dl_context_restore(g_proto[i].lhandle); 649 651 rv = g_proto[i].check_client(id, &vio); 652 if ( g_proto[i].lhandle != NULL ) 653 roar_dl_context_store(g_proto[i].lhandle); 650 654 } 651 655 } … … 686 690 687 691 if ( p->flush_client != NULL ) { 692 if ( p->lhandle != NULL ) 693 roar_dl_context_restore(p->lhandle); 688 694 return p->flush_client(id, &vio); 695 if ( p->lhandle != NULL ) 696 roar_dl_context_store(p->lhandle); 689 697 } 690 698 … … 716 724 if ( cs->outbuf == NULL ) { 717 725 if ( p->flushed_client != NULL ) { 726 if ( p->lhandle != NULL ) 727 roar_dl_context_restore(p->lhandle); 718 728 return p->flushed_client(id, &vio); 729 if ( p->lhandle != NULL ) 730 roar_dl_context_store(p->lhandle); 719 731 } 720 732 } … … 813 825 814 826 // proto support 815 int clients_register_proto(struct roard_proto * proto ) {827 int clients_register_proto(struct roard_proto * proto, struct roar_dl_lhandle * lhandle) { 816 828 const size_t len = sizeof(g_proto)/sizeof(*g_proto); 817 829 size_t i; … … 829 841 830 842 memcpy(&(g_proto[i]), proto, sizeof(*g_proto)); 843 844 g_proto[i].lhandle = lhandle; 831 845 832 846 return 0; -
roard/include/client.h
r5301 r5312 78 78 int subsystems; 79 79 const char * description; 80 struct roar_dl_lhandle * lhandle; 80 81 int (*new_client)(int client, struct roar_vio_calls * vio, struct roard_listen * lsock); 81 82 int (*check_client)(int client, struct roar_vio_calls * vio); … … 116 117 117 118 // proto support 118 int clients_register_proto (struct roard_proto * proto );119 int clients_register_proto (struct roard_proto * proto, struct roar_dl_lhandle * lhandle); 119 120 int clients_unregister_proto(int proto); 120 121 void print_protolist (enum output_format format); -
roard/plugins.c
r5275 r5312 57 57 int i; 58 58 59 if ( plugin->sched != NULL ) 60 if ( plugin->sched->free != NULL ) 59 if ( plugin->sched != NULL ) { 60 if ( plugin->sched->free != NULL ) { 61 roar_dl_context_restore(plugin->lhandle); 61 62 plugin->sched->free(); 63 roar_dl_context_store(plugin->lhandle); 64 } 65 } 62 66 63 67 for (i = 0; i < MAX_PROTOS; i++) { … … 87 91 } 88 92 89 if ( g_plugins[i].sched != NULL ) 90 if ( g_plugins[i].sched->init != NULL ) 93 if ( g_plugins[i].sched != NULL ) { 94 if ( g_plugins[i].sched->init != NULL ) { 95 roar_dl_context_restore(g_plugins[i].lhandle); 91 96 g_plugins[i].sched->init(); 97 roar_dl_context_store(g_plugins[i].lhandle); 98 } 99 } 92 100 93 101 _pp = NULL; … … 114 122 int i; 115 123 116 for (i = 0; i < MAX_PLUGINS; i++) 117 if ( g_plugins[i].lhandle != NULL ) 118 if ( g_plugins[i].sched != NULL ) 119 if ( g_plugins[i].sched->update != NULL ) 124 for (i = 0; i < MAX_PLUGINS; i++) { 125 if ( g_plugins[i].lhandle != NULL ) { 126 if ( g_plugins[i].sched != NULL ) { 127 if ( g_plugins[i].sched->update != NULL ) { 128 roar_dl_context_restore(g_plugins[i].lhandle); 120 129 if ( g_plugins[i].sched->update() == -1 ) 121 130 ret = -1; 131 roar_dl_context_store(g_plugins[i].lhandle); 132 } 133 } 134 } 135 } 122 136 123 137 return ret; … … 178 192 } 179 193 180 return clients_register_proto(proto );194 return clients_register_proto(proto, _pp->lhandle); 181 195 } 182 196
Note: See TracChangeset
for help on using the changeset viewer.