From d04e02cd8c335ec2833e7b05d233931fef8fd734 Mon Sep 17 00:00:00 2001 From: heyanlong Date: Wed, 12 Dec 2018 16:53:32 +0800 Subject: [PATCH] default port --- sky-php7ext/skywalking.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sky-php7ext/skywalking.c b/sky-php7ext/skywalking.c index 28d8dfa..079f008 100644 --- a/sky-php7ext/skywalking.c +++ b/sky-php7ext/skywalking.c @@ -157,10 +157,14 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS) if(url_info->port){ peer_port = url_info->port; } - if(peer_port > 0){ + if (peer_port > 0) { sprintf(peer, "%s:%d", url_info->host, peer_port); - }else{ - sprintf(peer, "%s", url_info->host); + } else { + if (strcasecmp("http", url_info->scheme) == 0) { + sprintf(peer, "%s:%d", url_info->host, 80); + } else { + sprintf(peer, "%s:%d", url_info->host, 443); + } } if (url_info->query) { -- GitLab