Compare commits

...

3 Commits

Author SHA1 Message Date
YuQing 5708f3f8d2 upgrade version to 1.2.14 2026-06-30 09:52:39 +08:00
YuQing f8737c1bce call format_ip_address alone 2026-06-26 11:11:55 +08:00
YuQing 01069c99ed sf_version() return combined integer version 2026-06-24 08:22:54 +08:00
5 changed files with 27 additions and 19 deletions

View File

@ -2,7 +2,7 @@
%define CommitVersion %(echo $COMMIT_VERSION)
Name: libserverframe
Version: 1.2.13
Version: 1.2.14
Release: 1%{?dist}
Summary: network framework library
License: AGPL v3.0
@ -12,9 +12,9 @@ Source: http://github.com/happyfish100/libserverframe/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libfastcommon-devel >= 1.0.85
BuildRequires: libfastcommon-devel >= 1.0.86
Requires: %__cp %__mv %__chmod %__grep %__mkdir %__install %__id
Requires: libfastcommon >= 1.0.85
Requires: libfastcommon >= 1.0.86
%description
common framework library

View File

@ -1030,6 +1030,8 @@ void sf_global_config_to_string_ex(const char *max_pkg_size_item_nm,
int max_buff_size;
Version fc_ver;
Version sf_ver;
int fc_ver_int;
int sf_ver_int;
char pkg_buff[256];
max_pkg_size = g_sf_global_vars.net_buffer_cfg.max_pkg_size -
@ -1049,17 +1051,19 @@ void sf_global_config_to_string_ex(const char *max_pkg_size_item_nm,
min_buff_size / 1024, max_buff_size / 1024);
}
fc_version(&fc_ver);
sf_version(&sf_ver);
fc_ver_int = fc_version(&fc_ver);
sf_ver_int = sf_version(&sf_ver);
len = snprintf(output, size, "libfastcommon version "
"{compile: %d.%d.%d, runtime: %d.%d.%d}, "
"{compile: %d.%d.%d %s runtime: %d.%d.%d}, "
"libserverframe version "
"{compile: %d.%d.%d, runtime: %d.%d.%d}, "
"{compile: %d.%d.%d %s runtime: %d.%d.%d}, "
"base_path=%s, max_connections=%d, connect_timeout=%d, "
"network_timeout=%d, thread_stack_size=%d KB, %s, ",
FC_MAJOR_VERSION, FC_MINOR_VERSION, FC_PATCH_VERSION,
FC_COMPARE_INT_VERSIONS_TO_OPERATOR_STR(FC_VERSION_INT, fc_ver_int),
fc_ver.major, fc_ver.minor, fc_ver.patch,
SF_MAJOR_VERSION, SF_MINOR_VERSION, SF_PATCH_VERSION,
FC_COMPARE_INT_VERSIONS_TO_OPERATOR_STR(SF_VERSION_INT, sf_ver_int),
sf_ver.major, sf_ver.minor, sf_ver.patch,
SF_G_BASE_PATH_STR,
g_sf_global_vars.net_buffer_cfg.max_connections,

View File

@ -641,12 +641,12 @@ int sf_proto_deal_task_done(struct fast_task_info *task,
char time_buff[32];
if (ctx->log_level != LOG_NOTHING && ctx->response.error.length > 0) {
format_ip_address(task->client_ip, formatted_ip);
log_it_ex(&g_log_context, ctx->log_level,
"file: "__FILE__", line: %d, %s "
"peer %s:%u, cmd: %d (%s), req body length: %d, "
"resp status: %d, %s", __LINE__, service_name,
format_ip_address(task->client_ip, formatted_ip),
task->port, ctx->request.header.cmd,
formatted_ip, task->port, ctx->request.header.cmd,
GET_CMD_CAPTION(ctx->request.header.cmd),
ctx->request.header.body_len, ctx->response.header.status,
ctx->response.error.message);
@ -656,11 +656,11 @@ int sf_proto_deal_task_done(struct fast_task_info *task,
if (sf_handler_ctx.callbacks.get_cmd_log_level != NULL) {
time_used = get_current_time_us() - ctx->req_start_time;
log_level = GET_CMD_LOG_LEVEL(ctx->request.header.cmd);
format_ip_address(task->client_ip, formatted_ip);
log_it_ex(&g_log_context, log_level, "file: "__FILE__", line: %d, "
"%s client %s:%u, req cmd: %d (%s), req body_len: %d, "
"resp status: %d, time used: %s us", __LINE__, service_name,
format_ip_address(task->client_ip, formatted_ip),
task->port, ctx->request.header.cmd,
formatted_ip, task->port, ctx->request.header.cmd,
GET_CMD_CAPTION(ctx->request.header.cmd),
ctx->request.header.body_len, ctx->response.header.status,
long_to_comma_str(time_used, time_buff));
@ -698,12 +698,12 @@ int sf_proto_deal_task_done(struct fast_task_info *task,
char buff[256];
int blen;
format_ip_address(task->client_ip, formatted_ip);
blen = sprintf(buff, "timed used: %s us, %s client %s:%u, "
"req cmd: %d (%s), req body len: %d, resp cmd: %d (%s), "
"status: %d, resp body len: %d", long_to_comma_str(time_used,
time_buff), service_name, format_ip_address(task->
client_ip, formatted_ip), task->port, ctx->request.
header.cmd, GET_CMD_CAPTION(ctx->request.header.cmd),
time_buff), service_name, formatted_ip, task->port, ctx->
request.header.cmd, GET_CMD_CAPTION(ctx->request.header.cmd),
ctx->request.header.body_len, ctx->response.header.cmd,
GET_CMD_CAPTION(ctx->response.header.cmd),
ctx->response.header.status, ctx->response.header.body_len);
@ -712,12 +712,12 @@ int sf_proto_deal_task_done(struct fast_task_info *task,
if (sf_handler_ctx.callbacks.get_cmd_log_level != NULL) {
log_level = GET_CMD_LOG_LEVEL(ctx->request.header.cmd);
format_ip_address(task->client_ip, formatted_ip);
log_it_ex(&g_log_context, log_level, "file: "__FILE__", line: %d, "
"%s client %s:%u, req cmd: %d (%s), req body_len: %d, "
"resp cmd: %d (%s), status: %d, resp body_len: %d, "
"time used: %s us", __LINE__, service_name,
format_ip_address(task->client_ip, formatted_ip),
task->port, ctx->request.header.cmd,
formatted_ip, task->port, ctx->request.header.cmd,
GET_CMD_CAPTION(ctx->request.header.cmd),
ctx->request.header.body_len, ctx->response.header.cmd,
GET_CMD_CAPTION(ctx->response.header.cmd),

View File

@ -15,9 +15,10 @@
#include "sf_version.h"
void sf_version(Version *version)
int sf_version(Version *version)
{
version->major = SF_MAJOR_VERSION;
version->minor = SF_MINOR_VERSION;
version->patch = SF_PATCH_VERSION;
return FC_VERSION_TO_INT1(*version);
}

View File

@ -22,13 +22,16 @@
#define SF_MAJOR_VERSION 1
#define SF_MINOR_VERSION 2
#define SF_PATCH_VERSION 13
#define SF_PATCH_VERSION 14
#define SF_VERSION_INT FC_VERSION_TO_INT(SF_MAJOR_VERSION, \
SF_MINOR_VERSION, SF_PATCH_VERSION)
#ifdef __cplusplus
extern "C" {
#endif
void sf_version(Version *version);
int sf_version(Version *version);
#ifdef __cplusplus
}