Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
59e71341
提交
59e71341
authored
9月 23, 2014
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix possible buffer overrun in websocket uri and sync the ws.c between sofia and verto
上级
0cc7bc8d
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
16 行删除
+13
-16
.update
libs/sofia-sip/.update
+1
-1
tport_type_ws.c
libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c
+1
-1
ws.c
libs/sofia-sip/libsofia-sip-ua/tport/ws.c
+9
-13
ws.h
libs/sofia-sip/libsofia-sip-ua/tport/ws.h
+2
-1
没有找到文件。
libs/sofia-sip/.update
浏览文件 @
59e71341
Sat Aug 16 01:34:24
CDT 2014
Tue Sep 23 20:16:55
CDT 2014
libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c
浏览文件 @
59e71341
...
...
@@ -475,7 +475,7 @@ int tport_ws_init_secondary(tport_t *self, int socket, int accepted,
memset
(
&
wstp
->
ws
,
0
,
sizeof
(
wstp
->
ws
));
if
(
ws_init
(
&
wstp
->
ws
,
socket
,
wstp
->
ws_secure
?
wspri
->
ssl_ctx
:
NULL
,
0
,
0
)
<
0
)
{
if
(
ws_init
(
&
wstp
->
ws
,
socket
,
wstp
->
ws_secure
?
wspri
->
ssl_ctx
:
NULL
,
0
,
0
,
0
)
<
0
)
{
ws_destroy
(
&
wstp
->
ws
);
wstp
->
ws_initialized
=
-
1
;
return
*
return_reason
=
"WS_INIT"
,
-
1
;
...
...
libs/sofia-sip/libsofia-sip-ua/tport/ws.c
浏览文件 @
59e71341
#include "ws.h"
#include <pthread.h>
#ifdef _MSC_VER
/* warning C4706: assignment within conditional expression*/
#pragma warning(disable: 4706)
#endif
#ifndef _MSC_VER
#include <fcntl.h>
#endif
...
...
@@ -269,7 +264,7 @@ int ws_handshake(wsh_t *wsh)
goto
err
;
}
*
(
wsh
->
buffer
+
bytes
)
=
'\0'
;
*
(
wsh
->
buffer
+
wsh
->
datalen
)
=
'\0'
;
if
(
strncasecmp
(
wsh
->
buffer
,
"GET "
,
4
))
{
goto
err
;
...
...
@@ -317,15 +312,15 @@ int ws_handshake(wsh_t *wsh)
err:
if
(
!
wsh
->
stay_open
)
{
snprintf
(
respond
,
sizeof
(
respond
),
"HTTP/1.1 400 Bad Request
\r\n
"
"Sec-WebSocket-Version: 13
\r\n\r\n
"
);
//printf("ERR:\n%s\n", respond);
ws_raw_write
(
wsh
,
respond
,
strlen
(
respond
));
ws_close
(
wsh
,
WS_NONE
);
}
return
-
1
;
...
...
@@ -543,7 +538,7 @@ static int establish_logical_layer(wsh_t *wsh)
}
int
ws_init
(
wsh_t
*
wsh
,
ws_socket_t
sock
,
SSL_CTX
*
ssl_ctx
,
int
close_sock
,
int
block
)
int
ws_init
(
wsh_t
*
wsh
,
ws_socket_t
sock
,
SSL_CTX
*
ssl_ctx
,
int
close_sock
,
int
block
,
int
stay_open
)
{
memset
(
wsh
,
0
,
sizeof
(
*
wsh
));
...
...
@@ -551,6 +546,7 @@ int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int
wsh
->
block
=
block
;
wsh
->
sanity
=
5000
;
wsh
->
ssl_ctx
=
ssl_ctx
;
wsh
->
stay_open
=
stay_open
;
if
(
!
ssl_ctx
)
{
ssl_ctx
=
ws_globals
.
ssl_ctx
;
...
...
libs/sofia-sip/libsofia-sip-ua/tport/ws.h
浏览文件 @
59e71341
...
...
@@ -88,6 +88,7 @@ typedef struct wsh_s {
int
sanity
;
int
secure_established
;
int
logical_established
;
int
stay_open
;
int
x
;
void
*
write_buffer
;
size_t
write_buffer_len
;
...
...
@@ -101,7 +102,7 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block);
ssize_t
ws_raw_write
(
wsh_t
*
wsh
,
void
*
data
,
size_t
bytes
);
ssize_t
ws_read_frame
(
wsh_t
*
wsh
,
ws_opcode_t
*
oc
,
uint8_t
**
data
);
ssize_t
ws_write_frame
(
wsh_t
*
wsh
,
ws_opcode_t
oc
,
void
*
data
,
size_t
bytes
);
int
ws_init
(
wsh_t
*
wsh
,
ws_socket_t
sock
,
SSL_CTX
*
ssl_ctx
,
int
close_sock
,
int
block
);
int
ws_init
(
wsh_t
*
wsh
,
ws_socket_t
sock
,
SSL_CTX
*
ssl_ctx
,
int
close_sock
,
int
block
,
int
stay_open
);
ssize_t
ws_close
(
wsh_t
*
wsh
,
int16_t
reason
);
void
ws_destroy
(
wsh_t
*
wsh
);
void
init_ssl
(
void
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论