From d0feb95f2a4cb569c34fb892e859d9bd1acdb8b0 Mon Sep 17 00:00:00 2001 From: heyanlong Date: Wed, 24 Jun 2020 19:31:21 +0800 Subject: [PATCH] Fix bugs --- .travis.yml | 8 ++++---- skywalking.c | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1cdfff..becb9de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,10 @@ services: - docker php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 + - 7.1-nts + - 7.2-nts + - 7.3-nts + - 7.4-nts - nightly matrix: diff --git a/skywalking.c b/skywalking.c index fd489e6..51dc46b 100644 --- a/skywalking.c +++ b/skywalking.c @@ -363,6 +363,15 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) { if (Z_TYPE_P(p) == IS_STRING) { add_assoc_string(&tags, "rpc.method", Z_STRVAL_P(p)); } + + // peer + zval *hostname = sky_read_property(&(execute_data->This), "hostname"); + if (Z_TYPE_P(hostname) == IS_STRING) { + const char *host = ZSTR_VAL(Z_STR_P(hostname)); + peer = (char *) emalloc(strlen(host) + 10); + bzero(peer, strlen(host) + 10); + sprintf(peer, "%s", host); + } } zval temp; -- GitLab