Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c1acebdb
提交
c1acebdb
authored
6月 01, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
patch incomplete multipart parsing code
上级
ccdaabd6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
64 行增加
和
9 行删除
+64
-9
msg_mime.c
libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c
+14
-8
nua_session.c
libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
+50
-1
没有找到文件。
libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c
浏览文件 @
c1acebdb
...
@@ -378,7 +378,7 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
...
@@ -378,7 +378,7 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
msg_t
msg
[
1
]
=
{{{
SU_HOME_INIT
(
msg
)
}}};
msg_t
msg
[
1
]
=
{{{
SU_HOME_INIT
(
msg
)
}}};
size_t
len
,
m
,
blen
;
size_t
len
,
m
,
blen
;
char
*
boundary
,
*
p
,
*
next
,
save
;
char
*
boundary
,
*
p
,
*
next
,
save
;
char
const
*
b
,
*
end
;
char
*
b
,
*
end
;
msg_param_t
param
;
msg_param_t
param
;
p
=
pl
->
pl_data
;
len
=
pl
->
pl_len
;
end
=
p
+
len
;
p
=
pl
->
pl_data
;
len
=
pl
->
pl_len
;
end
=
p
+
len
;
...
@@ -438,8 +438,11 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
...
@@ -438,8 +438,11 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
*
mmp
=
mp
;
mmp
=
&
mp
->
mp_next
;
*
mmp
=
mp
;
mmp
=
&
mp
->
mp_next
;
/* Put delimiter transport-padding CRLF here */
/* Put delimiter transport-padding CRLF here */
mp
->
mp_common
->
h_data
=
b
;
*
b
=
'\0'
;
mp
->
mp_common
->
h_len
=
p
-
b
;
mp
->
mp_common
->
h_len
=
p
-
b
;
b
+=
strlen
(
boundary
)
-
2
;
mp
->
mp_common
->
h_data
=
b
;
/* .. and body-part here */
/* .. and body-part here */
mp
->
mp_data
=
p
;
mp
->
mp_data
=
p
;
...
@@ -449,14 +452,17 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
...
@@ -449,14 +452,17 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
/* We found close-delimiter */
/* We found close-delimiter */
assert
(
mp
);
assert
(
mp
);
if
(
!
mp
)
if
(
!
mp
)
break
;
/* error */
break
;
/* error */
mp
->
mp_close_delim
=
(
msg_payload_t
*
)
mp
->
mp_close_delim
=
(
msg_payload_t
*
)
msg_header_alloc
(
msg_home
(
msg
),
msg_payload_class
,
0
);
msg_header_alloc
(
msg_home
(
msg
),
msg_payload_class
,
0
);
if
(
!
mp
->
mp_close_delim
)
if
(
!
mp
->
mp_close_delim
)
break
;
/* error */
break
;
/* error */
/* Include also transport-padding and epilogue in the close-delimiter */
/* Include also transport-padding and epilogue in the close-delimiter */
mp
->
mp_close_delim
->
pl_data
=
next
;
*
next
=
'\0'
;
mp
->
mp_close_delim
->
pl_len
=
p
+
len
-
next
;
mp
->
mp_close_delim
->
pl_len
=
p
+
len
-
next
;
next
+=
strlen
(
boundary
)
-
2
;
mp
->
mp_close_delim
->
pl_data
=
next
;
break
;
break
;
}
}
...
@@ -515,8 +521,8 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
...
@@ -515,8 +521,8 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
mp
->
mp_data
=
boundary
;
mp
->
mp_data
=
boundary
;
mp
->
mp_len
=
(
unsigned
)
blen
;
/* XXX */
mp
->
mp_len
=
(
unsigned
)
blen
;
/* XXX */
assert
(
mp
->
mp_payload
||
mp
->
mp_separator
)
;
if
(
!
(
mp
->
mp_payload
||
mp
->
mp_separator
))
continue
;
if
(
mp
->
mp_close_delim
)
{
if
(
mp
->
mp_close_delim
)
{
msg_header_t
**
tail
;
msg_header_t
**
tail
;
...
...
libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
浏览文件 @
c1acebdb
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include <sofia-sip/sip_status.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/sip_util.h>
#include <sofia-sip/sip_util.h>
#include <sofia-sip/su_uniqueid.h>
#include <sofia-sip/su_uniqueid.h>
#include <sofia-sip/msg_mime_protos.h>
#define NTA_INCOMING_MAGIC_T struct nua_server_request
#define NTA_INCOMING_MAGIC_T struct nua_server_request
#define NTA_OUTGOING_MAGIC_T struct nua_client_request
#define NTA_OUTGOING_MAGIC_T struct nua_client_request
...
@@ -2114,7 +2115,7 @@ nua_session_server_init(nua_server_request_t *sr)
...
@@ -2114,7 +2115,7 @@ nua_session_server_init(nua_server_request_t *sr)
msg_t
*
msg
=
sr
->
sr_response
.
msg
;
msg_t
*
msg
=
sr
->
sr_response
.
msg
;
sip_t
*
sip
=
sr
->
sr_response
.
sip
;
sip_t
*
sip
=
sr
->
sr_response
.
sip
;
sip_t
const
*
request
=
sr
->
sr_request
.
sip
;
sip_t
*
request
=
(
sip_t
*
)
sr
->
sr_request
.
sip
;
if
(
!
sr
->
sr_initial
)
if
(
!
sr
->
sr_initial
)
sr
->
sr_usage
=
nua_dialog_usage_get
(
nh
->
nh_ds
,
nua_session_usage
,
NULL
);
sr
->
sr_usage
=
nua_dialog_usage_get
(
nh
->
nh_ds
,
nua_session_usage
,
NULL
);
...
@@ -2135,6 +2136,54 @@ nua_session_server_init(nua_server_request_t *sr)
...
@@ -2135,6 +2136,54 @@ nua_session_server_init(nua_server_request_t *sr)
/* XXX - soa should know what it supports */
/* XXX - soa should know what it supports */
sip_add_dup
(
msg
,
sip
,
(
sip_header_t
*
)
a
);
sip_add_dup
(
msg
,
sip
,
(
sip_header_t
*
)
a
);
/* if we see there is a multipart content-type,
parse it into the sip structre and find the SDP and replace it
into the request as the requested content */
if
(
request
->
sip_content_type
&&
su_casenmatch
(
request
->
sip_content_type
->
c_type
,
"multipart/"
,
10
))
{
msg_multipart_t
*
mp
,
*
mpp
;
if
(
request
->
sip_multipart
)
{
mp
=
request
->
sip_multipart
;
}
else
{
mp
=
msg_multipart_parse
(
msg_home
(
msg
),
request
->
sip_content_type
,
(
sip_payload_t
*
)
request
->
sip_payload
);
request
->
sip_multipart
=
mp
;
}
if
(
mp
)
{
int
sdp
=
0
;
/* extract the SDP and set the primary content-type and payload to that SDP as if it was the only content so SOA will work */
for
(
mpp
=
mp
;
mpp
;
mpp
=
mpp
->
mp_next
)
{
if
(
mpp
->
mp_content_type
&&
mpp
->
mp_content_type
->
c_type
&&
mpp
->
mp_payload
&&
mpp
->
mp_payload
->
pl_data
&&
su_casenmatch
(
mpp
->
mp_content_type
->
c_type
,
"application/sdp"
,
15
))
{
request
->
sip_content_type
=
msg_content_type_dup
(
msg_home
(
msg
),
mpp
->
mp_content_type
);
if
(
request
->
sip_content_length
)
{
request
->
sip_content_length
->
l_length
=
mpp
->
mp_payload
->
pl_len
;
}
request
->
sip_payload
->
pl_data
=
su_strdup
(
msg_home
(
msg
),
mpp
->
mp_payload
->
pl_data
);
request
->
sip_payload
->
pl_len
=
mpp
->
mp_payload
->
pl_len
;
sdp
++
;
break
;
}
}
/* insist on the existance of a SDP in the content or refuse the request */
if
(
!
sdp
)
{
return
SR_STATUS1
(
sr
,
SIP_406_NOT_ACCEPTABLE
);
}
}
}
/* Make sure caller uses application/sdp without compression */
/* Make sure caller uses application/sdp without compression */
if
(
nta_check_session_content
(
NULL
,
request
,
a
,
TAG_END
()))
{
if
(
nta_check_session_content
(
NULL
,
request
,
a
,
TAG_END
()))
{
sip_add_make
(
msg
,
sip
,
sip_accept_encoding_class
,
""
);
sip_add_make
(
msg
,
sip
,
sip_accept_encoding_class
,
""
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论