Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
360cc4bf
S
SkyAPM-php-sdk
项目概览
SkyAPM
/
SkyAPM-php-sdk
通知
14
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyAPM-php-sdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
360cc4bf
编写于
12月 20, 2018
作者:
H
heyanlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs
上级
3b80ddf9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
24 deletion
+24
-24
sky-php7ext/skywalking.c
sky-php7ext/skywalking.c
+24
-24
未找到文件。
sky-php7ext/skywalking.c
浏览文件 @
360cc4bf
...
...
@@ -337,9 +337,9 @@ void sky_curl_setopt_handler(INTERNAL_FUNCTION_PARAMETERS) {
}
void
sky_curl_setopt_array_handler
(
INTERNAL_FUNCTION_PARAMETERS
)
{
zval
*
zid
,
*
arr
,
*
entry
;
zend_ulong
option
;
zend_string
*
string_key
;
zval
*
zid
,
*
arr
,
*
entry
;
zend_ulong
option
;
zend_string
*
string_key
;
ZEND_PARSE_PARAMETERS_START
(
2
,
2
)
Z_PARAM_RESOURCE
(
zid
)
...
...
@@ -349,29 +349,29 @@ void sky_curl_setopt_array_handler(INTERNAL_FUNCTION_PARAMETERS) {
zend_ulong
key
=
(
zend_ulong
)
Z_RES_VAL_P
(
zid
);
zval
*
current_header
=
zend_hash_index_find
(
Z_ARRVAL_P
(
&
SKYWALKING_G
(
curl_header
)),
key
);
ZEND_HASH_FOREACH_KEY_VAL
(
Z_ARRVAL_P
(
arr
),
option
,
string_key
,
entry
)
{
if
(
string_key
)
{
php_error_docref
(
NULL
,
E_WARNING
,
"Array keys must be CURLOPT constants or equivalent integer values"
);
RETURN_FALSE
;
}
if
(
CURLOPT_HTTPHEADER
==
option
)
{
if
(
current_header
==
NULL
)
{
zval
temp
;
array_init
(
&
temp
);
add_assoc_long
(
&
temp
,
"exec_call"
,
0
);
add_assoc_zval
(
&
temp
,
"header"
,
entry
);
zend_hash_index_add
(
Z_ARRVAL_P
(
&
SKYWALKING_G
(
curl_header
)),
key
,
&
temp
);
}
else
{
zend_string
*
header
=
zend_string_init
(
"header"
,
sizeof
(
"header"
)
-
1
,
0
);
zend_hash_update
(
Z_ARRVAL_P
(
current_header
),
header
,
entry
);
zend_string_release
(
header
);
}
}
zval
*
header_opt
=
zend_hash_index_find
(
Z_ARRVAL_P
(
arr
),
CURLOPT_HTTPHEADER
);
if
(
header_opt
!=
NULL
)
{
zend_long
_key
;
zval
*
_value
;
zval
header
;
array_init
(
&
header
);
ZEND_HASH_FOREACH_NUM_KEY_VAL
(
Z_ARRVAL_P
(
header_opt
),
_key
,
_value
)
{
add_next_index_string
(
&
header
,
Z_STRVAL_P
(
_value
));
}
ZEND_HASH_FOREACH_END
();
if
(
current_header
==
NULL
)
{
zval
temp
;
array_init
(
&
temp
);
add_assoc_long
(
&
temp
,
"exec_call"
,
0
);
add_assoc_zval
(
&
temp
,
"header"
,
&
header
);
zend_hash_index_add
(
Z_ARRVAL_P
(
&
SKYWALKING_G
(
curl_header
)),
key
,
&
temp
);
}
else
{
zend_string
*
_header
=
zend_string_init
(
"header"
,
sizeof
(
"header"
)
-
1
,
0
);
zend_hash_update
(
Z_ARRVAL_P
(
current_header
),
_header
,
&
header
);
zend_string_release
(
_header
);
}
}
orig_curl_setopt_array
(
INTERNAL_FUNCTION_PARAM_PASSTHRU
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录