提交 d016eccf 编写于 作者: H heyanlong

default port

上级 d04e02cd
...@@ -180,7 +180,6 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS) ...@@ -180,7 +180,6 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
char *sw3 = generate_sw3(Z_LVAL_P(span_id) + 1, _peer_host, _op_name); char *sw3 = generate_sw3(Z_LVAL_P(span_id) + 1, _peer_host, _op_name);
zend_string_release(_peer_host); zend_string_release(_peer_host);
zend_string_release(_op_name); zend_string_release(_op_name);
if (sw3 != NULL) { if (sw3 != NULL) {
zval z_sw3; zval z_sw3;
array_init(&z_sw3); array_init(&z_sw3);
...@@ -207,18 +206,21 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS) ...@@ -207,18 +206,21 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
orig_curl_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU); orig_curl_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU);
zval function_name_1,curlInfo_1;
call_user_function(CG(function_table), NULL, &function_name, &curlInfo, 1, params); zval params_1[1];
zval_dtor(&params[0]); ZVAL_COPY(&params_1[0], zid);
zval_dtor(&function_name); ZVAL_STRING(&function_name_1, "curl_getinfo");
call_user_function(CG(function_table), NULL, &function_name_1, &curlInfo_1, 1, params_1);
zval_dtor(&params_1[0]);
zval_dtor(&function_name_1);
zval *z_http_code; zval *z_http_code;
l_millisecond = get_millisecond(); l_millisecond = get_millisecond();
millisecond = zend_atol(l_millisecond, strlen(l_millisecond)); millisecond = zend_atol(l_millisecond, strlen(l_millisecond));
efree(l_millisecond); efree(l_millisecond);
z_http_code = zend_hash_str_find(Z_ARRVAL(curlInfo), ZEND_STRL("http_code")); z_http_code = zend_hash_str_find(Z_ARRVAL(curlInfo_1), ZEND_STRL("http_code"));
zval_dtor(&curlInfo); zval_dtor(&curlInfo_1);
add_assoc_long(&temp, "endTime", millisecond); add_assoc_long(&temp, "endTime", millisecond);
...@@ -278,17 +280,13 @@ static void write_log(char *text) { ...@@ -278,17 +280,13 @@ static void write_log(char *text) {
char message[strlen(text) + 1]; char message[strlen(text) + 1];
log_path = SKY_G(log_path); log_path = SKY_G(log_path);
zend_string *date_fmt, *_log_path, *_log_path_lower; zend_string *_log_path, *_log_path_lower;
time_t t;
t = time(NULL);
date_fmt = php_format_date("YmdHi", sizeof("YmdHi") - 1, t, 1);
_log_path = zend_string_init(log_path, strlen(log_path), 0); _log_path = zend_string_init(log_path, strlen(log_path), 0);
_log_path_lower = php_string_tolower(_log_path); _log_path_lower = php_string_tolower(_log_path);
bzero(logFilename, 100); bzero(logFilename, 100);
sprintf(logFilename, "%s/skywalking.%s.log", ZSTR_VAL(_log_path_lower), ZSTR_VAL(date_fmt)); sprintf(logFilename, "%s/skywalking.%d.log", ZSTR_VAL(_log_path_lower), get_second());
zend_string_release(date_fmt);
zend_string_release(_log_path); zend_string_release(_log_path);
zend_string_release(_log_path_lower); zend_string_release(_log_path_lower);
bzero(message, strlen(text)); bzero(message, strlen(text));
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <string> #include <string>
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#include <sys/time.h>
#include <regex> #include <regex>
#include <chrono> #include <chrono>
#include <cstdio> #include <cstdio>
...@@ -118,12 +119,11 @@ int main(int argc, char **argv) { ...@@ -118,12 +119,11 @@ int main(int argc, char **argv) {
if (valid) { if (valid) {
time_t t = time(NULL); struct timeval tv;
t = t - 65; gettimeofday(&tv,NULL);
char ch[64] = {0};
strftime(ch, sizeof(ch) - 1, "%Y%m%d%H%M", localtime(&t)); long fileTime = std::stol(result[1]);
unsigned long fileTime = std::stoul(result[1]); long localTime = tv.tv_sec - 3;
unsigned long localTime = std::stoul(ch);
if (fileTime < localTime) { if (fileTime < localTime) {
std::ifstream file; std::ifstream file;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册