equal
deleted
inserted
replaced
106 } |
106 } |
107 |
107 |
108 /** |
108 /** |
109 * Determine which transport is better suited for a given app. |
109 * Determine which transport is better suited for a given app. |
110 */ |
110 */ |
111 JingleTransportFuncs *jingle_transport_for_app(const gchar *appxmlns, GSList *forbid) |
111 JingleTransportFuncs *jingle_transport_for_app(const gchar *appxmlns, GSList **forbid) |
112 { |
112 { |
113 AppHandlerEntry *app = jingle_find_app(appxmlns); |
113 AppHandlerEntry *app = jingle_find_app(appxmlns); |
114 GSList *entry; |
114 GSList *entry; |
115 TransportHandlerEntry *thistransport, *besttransport; |
115 TransportHandlerEntry *thistransport, *besttransport; |
116 JingleTransportPriority bestprio; |
116 JingleTransportPriority bestprio; |
122 requestedtype = app->transtype; |
122 requestedtype = app->transtype; |
123 for (entry = jingle_transport_handlers; entry; entry = entry->next) { |
123 for (entry = jingle_transport_handlers; entry; entry = entry->next) { |
124 thistransport = (TransportHandlerEntry *) entry->data; |
124 thistransport = (TransportHandlerEntry *) entry->data; |
125 |
125 |
126 // Look if it's forbidden |
126 // Look if it's forbidden |
127 if (g_slist_find_custom(forbid, thistransport->xmlns, cmp_forbid)) |
127 if (g_slist_find_custom(*forbid, thistransport->xmlns, cmp_forbid)) |
128 continue; |
128 continue; |
129 |
129 |
130 if (thistransport->priority > bestprio) { |
130 if (thistransport->priority > bestprio) { |
131 bestprio = thistransport->priority; |
131 bestprio = thistransport->priority; |
132 besttransport = thistransport; |
132 besttransport = thistransport; |
133 } |
133 } |
134 } |
134 } |
135 |
135 *forbid = g_slist_append(*forbid, besttransport->xmlns); |
136 return besttransport->funcs; |
136 return besttransport->funcs; |
137 } |
137 } |
138 |
138 |
139 /** |
139 /** |
140 * This function should work with AppHandlerEntry and |
140 * This function should work with AppHandlerEntry and |