Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
98749510
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 搜索 >>
提交
98749510
编写于
6月 04, 2020
作者:
H
heyanlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bugs
上级
d208318c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
8 deletion
+9
-8
php_skywalking.h
php_skywalking.h
+1
-1
skywalking.c
skywalking.c
+8
-7
未找到文件。
php_skywalking.h
浏览文件 @
98749510
...
...
@@ -153,7 +153,7 @@ static long get_second();
static
char
*
get_millisecond
();
static
char
*
generate_sw3
(
zend_long
span_id
,
char
*
peer_host
,
char
*
operation_name
);
static
char
*
generate_sw6
(
zend_long
span_id
,
char
*
peer_host
);
static
char
*
generate_sw8
(
zend_long
span_id
);
static
char
*
generate_sw8
(
zend_long
span_id
,
char
*
peer_host
);
static
void
generate_context
();
static
char
*
get_page_request_uri
();
static
char
*
get_page_request_peer
();
...
...
skywalking.c
浏览文件 @
98749510
...
...
@@ -911,7 +911,7 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
sw
=
generate_sw6
(
Z_LVAL_P
(
span_id
)
+
1
,
peer
);
}
else
if
(
SKYWALKING_G
(
version
)
==
8
)
{
spprintf
(
&
peer
,
0
,
"%s:%d"
,
php_url_host
,
peer_port
);
sw
=
generate_sw8
(
Z_LVAL_P
(
span_id
)
+
1
);
sw
=
generate_sw8
(
Z_LVAL_P
(
span_id
)
+
1
,
peer
);
}
}
...
...
@@ -1259,11 +1259,10 @@ static char *generate_sw6(zend_long span_id, char *peer_host) {
return
sw6
;
}
static
char
*
generate_sw8
(
zend_long
span_id
)
{
static
char
*
generate_sw8
(
zend_long
span_id
,
char
*
peer_host
)
{
zval
*
traceId
=
zend_hash_str_find
(
Z_ARRVAL
(
SKYWALKING_G
(
context
)),
"traceId"
,
sizeof
(
"traceId"
)
-
1
);
zval
*
currentTraceId
=
zend_hash_str_find
(
Z_ARRVAL
(
SKYWALKING_G
(
context
)),
"currentTraceId"
,
sizeof
(
"currentTraceId"
)
-
1
);
zval
*
currentEndpoint
=
zend_hash_str_find
(
Z_ARRVAL
(
SKYWALKING_G
(
context
)),
"currentEndpoint"
,
sizeof
(
"currentEndpoint"
)
-
1
);
zval
*
currentNetworkAddress
=
zend_hash_str_find
(
Z_ARRVAL
(
SKYWALKING_G
(
context
)),
"currentNetworkAddress"
,
sizeof
(
"currentNetworkAddress"
)
-
1
);
zval
traceIdEncode
;
zval
currentTraceIdEncode
;
...
...
@@ -1277,7 +1276,7 @@ static char *generate_sw8(zend_long span_id) {
zval_b64_encode
(
&
serviceEncode
,
service
);
zval_b64_encode
(
&
serviceInstanceEncode
,
service_instance
);
zval_b64_encode
(
&
parentEndpointEncode
,
Z_STRVAL_P
(
currentEndpoint
));
zval_b64_encode
(
&
targetAddressEncode
,
Z_STRVAL_P
(
currentNetworkAddress
)
);
zval_b64_encode
(
&
targetAddressEncode
,
peer_host
);
ssize_t
sw6_l
=
0
;
sw6_l
=
snprintf
(
NULL
,
0
,
"sw8: 1-%s-%s-%"
PRId3264
"-%s-%s-%s-%s"
,
...
...
@@ -1649,8 +1648,11 @@ static char *get_page_request_peer() {
}
carrier
=
zend_hash_str_find
(
&
EG
(
symbol_table
),
ZEND_STRL
(
"_SERVER"
));
request_host
=
zend_hash_str_find
(
Z_ARRVAL_P
(
carrier
),
"
SERVER_ADDR"
,
sizeof
(
"SERVER_ADDR
"
)
-
1
);
request_host
=
zend_hash_str_find
(
Z_ARRVAL_P
(
carrier
),
"
HTTP_HOST"
,
sizeof
(
"HTTP_HOST
"
)
-
1
);
request_port
=
zend_hash_str_find
(
Z_ARRVAL_P
(
carrier
),
"SERVER_PORT"
,
sizeof
(
"SERVER_PORT"
)
-
1
);
if
(
request_host
==
NULL
)
{
request_host
=
zend_hash_str_find
(
Z_ARRVAL_P
(
carrier
),
"SERVER_ADDR"
,
sizeof
(
"SERVER_ADDR"
)
-
1
);
}
if
(
request_host
!=
NULL
&&
request_port
!=
NULL
)
{
peer_l
=
snprintf
(
NULL
,
0
,
"%s:%s"
,
Z_STRVAL_P
(
request_host
),
Z_STRVAL_P
(
request_port
));
...
...
@@ -1759,7 +1761,6 @@ static void request_init() {
// sw8 or sw6 for parent endpoint name
add_assoc_string
(
&
SKYWALKING_G
(
context
),
"currentEndpoint"
,
path
);
add_assoc_string
(
&
SKYWALKING_G
(
context
),
"currentNetworkAddress"
,
(
peer
==
NULL
)
?
"127.0.0.1:8080"
:
peer
);
efree
(
path
);
if
(
peer
!=
NULL
)
{
...
...
@@ -1778,7 +1779,7 @@ static void request_init() {
array_init
(
&
globalTraceIds
);
zval
tmpGlobalTraceIds
;
zend_hash_str_update
(
Z_ARRVAL
(
SKYWALKING_G
(
UpstreamSegment
)),
"traceId"
,
sizeof
(
"traceId"
)
-
1
,
traceId
);
add_assoc_string
(
&
SKYWALKING_G
(
UpstreamSegment
),
"traceId"
,
Z_STRVAL_P
(
traceId
)
);
if
(
Z_LVAL_P
(
isChild
)
==
1
)
{
zval
ref
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录