Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
aaeea2df
提交
aaeea2df
authored
12月 03, 2014
作者:
Brian West
提交者:
Ken Rice
12月 24, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7046: fix data types and casting on some vars to silence windows build warnings
上级
459ccb01
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
11 行增加
和
10 行删除
+11
-10
mcast.c
src/mod/endpoints/mod_verto/mcast/mcast.c
+5
-4
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+5
-5
mod_verto.h
src/mod/endpoints/mod_verto/mod_verto.h
+1
-1
没有找到文件。
src/mod/endpoints/mod_verto/mcast/mcast.c
浏览文件 @
aaeea2df
...
...
@@ -48,11 +48,12 @@
#ifndef WIN32
#include <unistd.h>
#endif
#include "mcast.h"
#ifndef WIN32
#include <poll.h>
#endif
#include <switch_utils.h>
#include "mcast.h"
int
mcast_socket_create
(
const
char
*
host
,
int16_t
port
,
mcast_handle_t
*
handle
,
mcast_flag_t
flags
)
{
...
...
@@ -68,7 +69,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
handle
->
send_addr
.
sin_addr
.
s_addr
=
inet_addr
(
host
);
handle
->
send_addr
.
sin_port
=
htons
(
port
);
if
(
setsockopt
(
handle
->
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
one
,
sizeof
(
one
))
!=
0
)
{
if
(
setsockopt
(
handle
->
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
void
*
)
&
one
,
sizeof
(
one
))
!=
0
)
{
close
(
handle
->
sock
);
return
-
1
;
}
...
...
@@ -84,7 +85,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
mreq
.
imr_multiaddr
.
s_addr
=
inet_addr
(
host
);
mreq
.
imr_interface
.
s_addr
=
htonl
(
INADDR_ANY
);
if
(
setsockopt
(
handle
->
sock
,
IPPROTO_IP
,
IP_ADD_MEMBERSHIP
,
&
mreq
,
sizeof
(
mreq
))
<
0
)
{
if
(
setsockopt
(
handle
->
sock
,
IPPROTO_IP
,
IP_ADD_MEMBERSHIP
,
(
void
*
)
&
mreq
,
sizeof
(
mreq
))
<
0
)
{
close
(
handle
->
sock
);
handle
->
sock
=
-
1
;
return
-
1
;
...
...
@@ -125,7 +126,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
handle
->
ttl
=
255
;
}
if
(
setsockopt
(
handle
->
sock
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
&
handle
->
ttl
,
sizeof
(
handle
->
ttl
))
!=
0
)
{
if
(
setsockopt
(
handle
->
sock
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
(
void
*
)
&
handle
->
ttl
,
sizeof
(
handle
->
ttl
))
!=
0
)
{
return
-
1
;
}
...
...
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
aaeea2df
...
...
@@ -1518,7 +1518,7 @@ new_req:
!
strncmp
(
request
.
content_type
,
"application/x-www-form-urlencoded"
,
33
))
{
char
*
buffer
=
NULL
;
in
t
len
=
0
,
bytes
=
0
;
switch_size_
t
len
=
0
,
bytes
=
0
;
if
(
request
.
content_length
>
2
*
1024
*
1024
-
1
)
{
char
*
data
=
"HTTP/1.1 413 Request Entity Too Large
\r\n
"
...
...
@@ -3737,7 +3737,7 @@ static int start_jsock(verto_profile_t *profile, ws_socket_t sock)
return
-
1
;
}
static
ws_socket_t
prepare_socket
(
int
ip
,
in
t
port
)
static
ws_socket_t
prepare_socket
(
int
ip
,
uint16_
t
port
)
{
ws_socket_t
sock
=
ws_sock_invalid
;
#ifndef WIN32
...
...
@@ -3842,7 +3842,7 @@ static int profile_one_loop(verto_profile_t *profile)
}
if
(
pfds
[
x
].
revents
&
SWITCH_POLL_READ
)
{
if
(
profile
->
mcast_ip
&&
pfds
[
x
].
sock
==
profile
->
mcast_sub
.
sock
)
{
if
(
profile
->
mcast_ip
&&
pfds
[
x
].
sock
==
(
switch_os_socket_t
)
profile
->
mcast_sub
.
sock
)
{
handle_mcast_sub
(
profile
);
}
else
{
start_jsock
(
profile
,
pfds
[
x
].
sock
);
...
...
@@ -3971,7 +3971,7 @@ static void do_shutdown(void)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Done
\n
"
);
}
static
void
parse_ip
(
char
*
host
,
in
t
*
port
,
in_addr_t
*
addr
,
char
*
input
)
static
void
parse_ip
(
char
*
host
,
uint16_
t
*
port
,
in_addr_t
*
addr
,
char
*
input
)
{
char
*
p
;
struct
hostent
*
hent
;
...
...
@@ -3980,7 +3980,7 @@ static void parse_ip(char *host, int *port, in_addr_t *addr, char *input)
if
((
p
=
strchr
(
host
,
':'
))
!=
NULL
)
{
*
p
++
=
'\0'
;
*
port
=
atoi
(
p
);
*
port
=
(
uint16_t
)
atoi
(
p
);
}
if
(
host
[
0
]
<
'0'
||
host
[
0
]
>
'9'
)
{
...
...
src/mod/endpoints/mod_verto/mod_verto.h
浏览文件 @
aaeea2df
...
...
@@ -156,7 +156,7 @@ typedef struct jsock_s jsock_t;
struct
ips
{
char
local_ip
[
256
];
in_addr_t
local_ip_addr
;
in
t
local_port
;
uint16_
t
local_port
;
int
secure
;
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论