working on segfaults
This commit is contained in:
parent
25a5b4267c
commit
3955c8a020
@ -167,20 +167,21 @@ int rtcp_map_put(rtcp_map* map, rtcp_token_type token, ioa_socket_handle s) {
|
||||
* <0 - not found
|
||||
*/
|
||||
ioa_socket_handle rtcp_map_get(rtcp_map* map, rtcp_token_type token) {
|
||||
if(!rtcp_map_valid(map)) return NULL;
|
||||
else {
|
||||
ur_map_value_type value;
|
||||
TURN_MUTEX_LOCK(&map->mutex);
|
||||
int ret = ur_map_get(map->map,token,&value);
|
||||
//TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO,"%s: 111.111: ret=%d, value=%llu, token=%llu\n",__FUNCTION__,ret,(unsigned long)value,token);
|
||||
rtcp_map_del_savefd(map, token);
|
||||
TURN_MUTEX_UNLOCK(&map->mutex);
|
||||
if(!ret) return NULL;
|
||||
rtcp_alloc_type* rval=(rtcp_alloc_type*)value;
|
||||
if(!rval) return NULL;
|
||||
//TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO,"%s: 111.222: ret=%d, token=%llu\n",__FUNCTION__,ret,token);
|
||||
return rval->s;
|
||||
}
|
||||
ioa_socket_handle s = NULL;
|
||||
if (rtcp_map_valid(map)) {
|
||||
ur_map_value_type value;
|
||||
TURN_MUTEX_LOCK(&map->mutex);
|
||||
int ret = ur_map_get(map->map, token, &value);
|
||||
if (ret) {
|
||||
rtcp_alloc_type* rval = (rtcp_alloc_type*) value;
|
||||
if (rval) {
|
||||
s = rval->s;
|
||||
}
|
||||
}
|
||||
rtcp_map_del_savefd(map, token);
|
||||
TURN_MUTEX_UNLOCK(&map->mutex);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static void rtcp_alloc_free(ur_map_value_type value)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user