Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
077fde22
提交
077fde22
authored
8月 01, 2017
作者:
Shane Bryldt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10167: Linux build updated and basic tests work as expected
上级
fd3348ca
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
24 行增加
和
50 行删除
+24
-50
blade_mastermgr.c
libs/libblade/src/blade_mastermgr.c
+10
-10
blade_protocol.c
libs/libblade/src/blade_protocol.c
+10
-10
blade_stack.c
libs/libblade/src/blade_stack.c
+3
-6
testcli.c
libs/libblade/test/testcli.c
+0
-1
ks_json.h
libs/libks/src/include/ks_json.h
+1
-4
ks_json.c
libs/libks/src/ks_json.c
+0
-19
没有找到文件。
libs/libblade/src/blade_mastermgr.c
浏览文件 @
077fde22
/*
* Copyright (c) 2017, Shane Bryldt
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
@@ -64,7 +64,7 @@ KS_DECLARE(ks_status_t) blade_mastermgr_create(blade_mastermgr_t **bmmgrP, blade
blade_mastermgr_t
*
bmmgr
=
NULL
;
ks_assert
(
bmmgrP
);
ks_pool_open
(
&
pool
);
ks_assert
(
pool
);
...
...
@@ -122,7 +122,7 @@ KS_DECLARE(ks_status_t) blade_mastermgr_purge(blade_mastermgr_t *bmmgr, const ch
if
(
blade_protocol_purge
(
bp
,
nodeid
))
{
if
(
!
cleanup
)
ks_hash_create
(
&
cleanup
,
KS_HASH_MODE_CASE_INSENSITIVE
,
KS_HASH_FLAG_RWLOCK
|
KS_HASH_FLAG_DUP_CHECK
,
bmmgr
->
pool
);
ks_hash_insert
(
cleanup
,
key
,
bp
);
ks_hash_insert
(
cleanup
,
(
void
*
)
key
,
bp
);
}
}
if
(
cleanup
)
{
...
...
@@ -133,7 +133,7 @@ KS_DECLARE(ks_status_t) blade_mastermgr_purge(blade_mastermgr_t *bmmgr, const ch
ks_hash_this
(
it
,
(
const
void
**
)
&
key
,
NULL
,
(
void
**
)
&
bp
);
ks_log
(
KS_LOG_DEBUG
,
"Protocol Removed: %s
\n
"
,
key
);
ks_hash_remove
(
bmmgr
->
protocols
,
key
);
ks_hash_remove
(
bmmgr
->
protocols
,
(
void
*
)
key
);
}
ks_hash_destroy
(
&
cleanup
);
}
...
...
@@ -276,7 +276,7 @@ KS_DECLARE(ks_status_t) blade_mastermgr_channel_authorize(blade_mastermgr_t *bmm
ret
=
KS_STATUS_NOT_FOUND
;
goto
done
;
}
ret
=
blade_protocol_channel_authorize
(
bp
,
remove
,
channel
,
controller
,
target
);
done
:
...
...
libs/libblade/src/blade_protocol.c
浏览文件 @
077fde22
/*
* Copyright (c) 2017, Shane Bryldt
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...
...
@@ -94,7 +94,7 @@ KS_DECLARE(ks_status_t) blade_protocol_create(blade_protocol_t **bpP, ks_pool_t
KS_DECLARE
(
ks_status_t
)
blade_protocol_destroy
(
blade_protocol_t
**
bpP
)
{
blade_protocol_t
*
bp
=
NULL
;
ks_assert
(
bpP
);
ks_assert
(
*
bpP
);
...
...
@@ -120,7 +120,7 @@ KS_DECLARE(ks_bool_t) blade_protocol_purge(blade_protocol_t *bp, const char *nod
ks_hash_this
(
it
,
(
const
void
**
)
&
key
,
NULL
,
(
void
**
)
&
authorizations
);
if
(
ks_hash_remove
(
authorizations
,
nodeid
))
{
if
(
ks_hash_remove
(
authorizations
,
(
void
*
)
nodeid
))
{
ks_log
(
KS_LOG_DEBUG
,
"Protocol Channel Authorization Removed: %s from %s@%s/%s
\n
"
,
nodeid
,
bp
->
name
,
bp
->
realm
,
key
);
}
}
...
...
@@ -180,7 +180,7 @@ KS_DECLARE(ks_status_t) blade_protocol_channel_add(blade_protocol_t *bp, const c
ks_hash_write_lock
(
bp
->
channels
);
if
(
ks_hash_search
(
bp
->
channels
,
name
,
KS_UNLOCKED
))
{
if
(
ks_hash_search
(
bp
->
channels
,
(
void
*
)
name
,
KS_UNLOCKED
))
{
ret
=
KS_STATUS_DUPLICATE_OPERATION
;
goto
done
;
}
...
...
@@ -262,7 +262,7 @@ KS_DECLARE(ks_bool_t) blade_protocol_channel_verify(blade_protocol_t *bp, const
// @todo verify controller, get ks_hash_t* value based on channel, add target to the channels hash
authorizations
=
(
ks_hash_t
*
)
ks_hash_search
(
bp
->
channels
,
(
void
*
)
channel
,
KS_READLOCKED
);
if
(
authorizations
)
ret
=
ks_hash_search
(
authorizations
,
target
,
KS_UNLOCKED
)
!=
NULL
;
if
(
authorizations
)
ret
=
ks_hash_search
(
authorizations
,
(
void
*
)
target
,
KS_UNLOCKED
)
!=
NULL
;
ks_hash_read_unlock
(
bp
->
channels
);
return
ret
;
...
...
libs/libblade/src/blade_stack.c
浏览文件 @
077fde22
...
...
@@ -1079,7 +1079,7 @@ KS_DECLARE(ks_status_t) blade_handle_rpcexecute(blade_handle_t *bh, const char *
ks_log
(
KS_LOG_DEBUG
,
"Session (%s) execute request started
\n
"
,
blade_session_id_get
(
bs
));
ret
=
blade_session_send
(
bs
,
req
,
callback
,
data
);
done
:
if
(
req
)
cJSON_Delete
(
req
);
if
(
bs
)
blade_session_read_unlock
(
bs
);
...
...
@@ -1176,7 +1176,7 @@ ks_bool_t blade_rpcexecute_request_handler(blade_rpc_request_t *brpcreq, void *d
blade_session_send
(
bs
,
res
,
NULL
,
NULL
);
goto
done
;
}
callback
=
blade_rpc_callback_get
(
brpc
);
if
(
callback
)
ret
=
callback
(
brpcreq
,
blade_rpc_data_get
(
brpc
));
...
...
@@ -1369,7 +1369,7 @@ KS_DECLARE(ks_status_t) blade_handle_rpcsubscribe(blade_handle_t *bh, const char
temp_data
->
channel_callback
=
channel_callback
;
temp_data
->
channel_data
=
channel_data
;
ks_pool_set_cleanup
(
pool
,
temp_data
,
NULL
,
blade_rpcsubscribe_data_cleanup
);
ret
=
blade_handle_rpcsubscribe_raw
(
bh
,
protocol
,
realm
,
subscribe_channels
,
unsubscribe_channels
,
localid
,
KS_FALSE
,
blade_rpcsubscribe_response_handler
,
temp_data
);
ks_pool_free
(
bh
->
pool
,
&
localid
);
...
...
@@ -1590,7 +1590,6 @@ done:
ks_bool_t
blade_rpcsubscribe_response_handler
(
blade_rpc_response_t
*
brpcres
,
void
*
data
)
{
ks_bool_t
ret
=
KS_FALSE
;
blade_rpc_request_t
*
brpcreq
=
NULL
;
blade_handle_t
*
bh
=
NULL
;
blade_session_t
*
bs
=
NULL
;
blade_rpcsubscribe_data_t
*
temp_data
=
NULL
;
...
...
@@ -1607,8 +1606,6 @@ ks_bool_t blade_rpcsubscribe_response_handler(blade_rpc_response_t *brpcres, voi
ks_assert
(
brpcres
);
ks_assert
(
data
);
brpcreq
=
blade_rpc_response_request_get
(
brpcres
);
bh
=
blade_rpc_response_handle_get
(
brpcres
);
ks_assert
(
bh
);
...
...
libs/libblade/test/testcli.c
浏览文件 @
077fde22
...
...
@@ -406,7 +406,6 @@ void command_unsubscribe(blade_handle_t *bh, char *args)
void
command_leave
(
blade_handle_t
*
bh
,
char
*
args
)
{
cJSON
*
params
=
NULL
;
cJSON
*
channels
=
NULL
;
ks_assert
(
bh
);
ks_assert
(
args
);
...
...
libs/libks/src/include/ks_json.h
浏览文件 @
077fde22
...
...
@@ -42,12 +42,9 @@ extern "C"
#include "ks_cJSON.h"
#include "ks_cJSON_Utils.h"
KS_DECLARE
(
cJSON
*
)
cJSON_CreateStringPrintf
(
const
char
*
fmt
,
...);
KS_DECLARE
(
const
char
*
)
cJSON_GetObjectCstr
(
const
cJSON
*
object
,
const
char
*
string
);
KS_DECLARE
(
cJSON
*
)
cJSON_CreatePtr
(
uintptr_t
pointer
);
KS_DECLARE
(
uintptr_t
)
cJSON_GetPtrValue
(
const
cJSON
*
object
);
KS_DECLARE
(
uintptr_t
)
cJSON_GetObjectPtr
(
const
cJSON
*
object
,
const
char
*
string
);
static
inline
cJSON
*
ks_json_add_child_obj
(
cJSON
*
json
,
const
char
*
name
,
cJSON
*
obj
)
{
...
...
libs/libks/src/ks_json.c
浏览文件 @
077fde22
...
...
@@ -28,25 +28,6 @@ KS_DECLARE(const char *) cJSON_GetObjectCstr(const cJSON *object, const char *st
return
cj
->
valuestring
;
}
KS_DECLARE
(
cJSON
*
)
cJSON_CreatePtr
(
uintptr_t
pointer
)
{
// @todo check for 32bit and use integer storage instead
return
cJSON_CreateStringPrintf
(
"%p"
,
(
void
*
)
pointer
);
}
KS_DECLARE
(
uintptr_t
)
cJSON_GetPtrValue
(
const
cJSON
*
object
)
{
// @todo check for 32bit and use integer storage instead
void
*
pointer
=
NULL
;
if
(
object
&&
object
->
type
==
cJSON_String
)
sscanf_s
(
object
->
valuestring
,
"%p"
,
&
pointer
);
return
(
uintptr_t
)
pointer
;
}
KS_DECLARE
(
uintptr_t
)
cJSON_GetObjectPtr
(
const
cJSON
*
object
,
const
char
*
string
)
{
return
cJSON_GetPtrValue
(
cJSON_GetObjectItem
(
object
,
string
));
}
/* For Emacs:
* Local Variables:
* mode:c
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论