Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
79a72ee7
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,发现更多精彩内容 >>
提交
79a72ee7
编写于
7月 19, 2019
作者:
w60514603
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加php7.3.0+支持
上级
a7c8de97
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
15 deletion
+30
-15
skywalking.c
skywalking.c
+30
-15
未找到文件。
skywalking.c
浏览文件 @
79a72ee7
...
@@ -432,20 +432,35 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
...
@@ -432,20 +432,35 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
ssize_t
full_url_l
=
0
;
ssize_t
full_url_l
=
0
;
char
*
full_url
=
NULL
;
char
*
full_url
=
NULL
;
if
(
is_send
==
1
)
{
if
(
is_send
==
1
)
{
// for php7.3.0+
#if PHP_VERSION_ID >= 70300
char
*
php_url_scheme
=
ZSTR_VAL
(
url_info
->
scheme
);
char
*
php_url_host
=
ZSTR_VAL
(
url_info
->
host
);
char
*
php_url_path
=
ZSTR_VAL
(
url_info
->
path
);
char
*
php_url_query
=
ZSTR_VAL
(
url_info
->
query
);
#else
char
*
php_url_scheme
=
url_info
->
scheme
;
char
*
php_url_host
=
url_info
->
host
;
char
*
php_url_path
=
url_info
->
path
;
char
*
php_url_query
=
url_info
->
query
;
#endif
int
peer_port
=
0
;
int
peer_port
=
0
;
if
(
url_info
->
port
)
{
if
(
url_info
->
port
)
{
peer_port
=
url_info
->
port
;
peer_port
=
url_info
->
port
;
}
else
{
}
else
{
if
(
strcasecmp
(
"http"
,
url_info
->
scheme
)
==
0
)
{
if
(
strcasecmp
(
"http"
,
php_url_
scheme
)
==
0
)
{
peer_port
=
80
;
peer_port
=
80
;
}
else
{
}
else
{
peer_port
=
443
;
peer_port
=
443
;
}
}
}
}
peer
=
(
char
*
)
emalloc
(
strlen
(
url_info
->
scheme
)
+
3
+
strlen
(
url_info
->
host
)
+
7
);
peer
=
(
char
*
)
emalloc
(
strlen
(
php_url_scheme
)
+
3
+
strlen
(
php_url_
host
)
+
7
);
bzero
(
peer
,
strlen
(
url_info
->
scheme
)
+
3
+
strlen
(
url_info
->
host
)
+
7
);
bzero
(
peer
,
strlen
(
php_url_scheme
)
+
3
+
strlen
(
php_url_
host
)
+
7
);
if
(
url_info
->
query
)
{
if
(
url_info
->
query
)
{
if
(
url_info
->
path
==
NULL
)
{
if
(
url_info
->
path
==
NULL
)
{
...
@@ -454,20 +469,20 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
...
@@ -454,20 +469,20 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
bzero
(
operation_name
,
operation_name_l
+
1
);
bzero
(
operation_name
,
operation_name_l
+
1
);
sprintf
(
operation_name
,
"%s"
,
"/"
);
sprintf
(
operation_name
,
"%s"
,
"/"
);
full_url_l
=
snprintf
(
NULL
,
0
,
"%s?%s"
,
"/"
,
url_info
->
query
);
full_url_l
=
snprintf
(
NULL
,
0
,
"%s?%s"
,
"/"
,
php_url_
query
);
full_url
=
(
char
*
)
emalloc
(
full_url_l
+
1
);
full_url
=
(
char
*
)
emalloc
(
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
sprintf
(
full_url
,
"%s?%s"
,
"/"
,
url_info
->
query
);
sprintf
(
full_url
,
"%s?%s"
,
"/"
,
php_url_
query
);
}
else
{
}
else
{
operation_name_l
=
snprintf
(
NULL
,
0
,
"%s"
,
url_info
->
path
);
operation_name_l
=
snprintf
(
NULL
,
0
,
"%s"
,
php_url_
path
);
operation_name
=
(
char
*
)
emalloc
(
operation_name_l
+
1
);
operation_name
=
(
char
*
)
emalloc
(
operation_name_l
+
1
);
bzero
(
operation_name
,
operation_name_l
+
1
);
bzero
(
operation_name
,
operation_name_l
+
1
);
sprintf
(
operation_name
,
"%s"
,
url_info
->
path
);
sprintf
(
operation_name
,
"%s"
,
php_url_
path
);
full_url_l
=
snprintf
(
NULL
,
0
,
"%s?%s"
,
url_info
->
path
,
url_info
->
query
);
full_url_l
=
snprintf
(
NULL
,
0
,
"%s?%s"
,
php_url_path
,
php_url_
query
);
full_url
=
(
char
*
)
emalloc
(
full_url_l
+
1
);
full_url
=
(
char
*
)
emalloc
(
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
sprintf
(
full_url
,
"%s?%s"
,
url_info
->
path
,
url_info
->
query
);
sprintf
(
full_url
,
"%s?%s"
,
php_url_path
,
php_url_
query
);
}
}
}
else
{
}
else
{
if
(
url_info
->
path
==
NULL
)
{
if
(
url_info
->
path
==
NULL
)
{
...
@@ -481,15 +496,15 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
...
@@ -481,15 +496,15 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
bzero
(
full_url
,
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
sprintf
(
full_url
,
"%s"
,
"/"
);
sprintf
(
full_url
,
"%s"
,
"/"
);
}
else
{
}
else
{
operation_name_l
=
snprintf
(
NULL
,
0
,
"%s"
,
url_info
->
path
);
operation_name_l
=
snprintf
(
NULL
,
0
,
"%s"
,
php_url_
path
);
operation_name
=
(
char
*
)
emalloc
(
operation_name_l
+
1
);
operation_name
=
(
char
*
)
emalloc
(
operation_name_l
+
1
);
bzero
(
operation_name
,
operation_name_l
+
1
);
bzero
(
operation_name
,
operation_name_l
+
1
);
sprintf
(
operation_name
,
"%s"
,
url_info
->
path
);
sprintf
(
operation_name
,
"%s"
,
php_url_
path
);
full_url_l
=
snprintf
(
NULL
,
0
,
"%s"
,
url_info
->
path
);
full_url_l
=
snprintf
(
NULL
,
0
,
"%s"
,
php_url_
path
);
full_url
=
(
char
*
)
emalloc
(
full_url_l
+
1
);
full_url
=
(
char
*
)
emalloc
(
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
bzero
(
full_url
,
full_url_l
+
1
);
sprintf
(
full_url
,
"%s"
,
url_info
->
path
);
sprintf
(
full_url
,
"%s"
,
php_url_
path
);
}
}
}
}
...
@@ -497,10 +512,10 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
...
@@ -497,10 +512,10 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
last_span
=
zend_hash_index_find
(
Z_ARRVAL_P
(
spans
),
zend_hash_num_elements
(
Z_ARRVAL_P
(
spans
))
-
1
);
last_span
=
zend_hash_index_find
(
Z_ARRVAL_P
(
spans
),
zend_hash_num_elements
(
Z_ARRVAL_P
(
spans
))
-
1
);
span_id
=
zend_hash_str_find
(
Z_ARRVAL_P
(
last_span
),
"spanId"
,
sizeof
(
"spanId"
)
-
1
);
span_id
=
zend_hash_str_find
(
Z_ARRVAL_P
(
last_span
),
"spanId"
,
sizeof
(
"spanId"
)
-
1
);
if
(
SKYWALKING_G
(
version
)
==
5
)
{
// skywalking 5.x
if
(
SKYWALKING_G
(
version
)
==
5
)
{
// skywalking 5.x
sprintf
(
peer
,
"%s://%s:%d"
,
url_info
->
scheme
,
url_info
->
host
,
peer_port
);
sprintf
(
peer
,
"%s://%s:%d"
,
php_url_scheme
,
php_url_
host
,
peer_port
);
sw
=
generate_sw3
(
Z_LVAL_P
(
span_id
)
+
1
,
peer
,
operation_name
);
sw
=
generate_sw3
(
Z_LVAL_P
(
span_id
)
+
1
,
peer
,
operation_name
);
}
else
if
(
SKYWALKING_G
(
version
)
==
6
)
{
// skywalking 6.x
}
else
if
(
SKYWALKING_G
(
version
)
==
6
)
{
// skywalking 6.x
sprintf
(
peer
,
"%s:%d"
,
url_info
->
host
,
peer_port
);
sprintf
(
peer
,
"%s:%d"
,
php_url_
host
,
peer_port
);
sw
=
generate_sw6
(
Z_LVAL_P
(
span_id
)
+
1
,
peer
,
operation_name
);
sw
=
generate_sw6
(
Z_LVAL_P
(
span_id
)
+
1
,
peer
,
operation_name
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录