Compare commits

..

4 Commits

Author SHA1 Message Date
YuQing eabc5d52ac log libfastcommon and libserverframe versions 2026-06-23 15:43:27 +08:00
YuQing 7782eb06ca add function sf_version 2026-06-23 15:41:54 +08:00
YuQing 5b7347a0fe upgrade version to 1.2.13 2026-06-23 09:49:07 +08:00
YuQing 1c8d134fa1 set connection_stat.max_count by CAS 2026-06-23 09:45:55 +08:00
6 changed files with 83 additions and 9 deletions

View File

@ -2,7 +2,7 @@
%define CommitVersion %(echo $COMMIT_VERSION)
Name: libserverframe
Version: 1.2.12
Version: 1.2.13
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.84
BuildRequires: libfastcommon-devel >= 1.0.85
Requires: %__cp %__mv %__chmod %__grep %__mkdir %__install %__id
Requires: libfastcommon >= 1.0.84
Requires: libfastcommon >= 1.0.85
%description
common framework library

View File

@ -10,7 +10,7 @@ TOP_HEADERS = sf_types.h sf_global.h sf_define.h sf_nio.h sf_service.h \
sf_sharding_htable.h sf_connection_manager.h sf_serializer.h \
sf_binlog_index.h sf_file_writer.h sf_binlog_writer.h \
sf_ordered_writer.h sf_buffered_writer.h sf_iov.h \
sf_shared_mbuffer.h
sf_shared_mbuffer.h sf_version.h
IDEMP_COMMON_HEADER = idempotency/common/idempotency_types.h
@ -34,7 +34,7 @@ SHARED_OBJS = sf_nio.lo sf_iov.lo sf_service.lo sf_global.lo \
sf_connection_manager.lo sf_serializer.lo \
sf_binlog_index.lo sf_file_writer.lo \
sf_binlog_writer.lo sf_ordered_writer.lo \
sf_shared_mbuffer.lo \
sf_shared_mbuffer.lo sf_version.lo \
idempotency/server/server_channel.lo \
idempotency/server/request_htable.lo \
idempotency/server/channel_htable.lo \

View File

@ -32,6 +32,8 @@
#include "fastcommon/process_ctrl.h"
#include "fastcommon/local_ip_func.h"
#include "fastcommon/logger.h"
#include "fastcommon/fc_version.h"
#include "sf_version.h"
#include "sf_nio.h"
#include "sf_service.h"
#include "sf_global.h"
@ -1026,6 +1028,8 @@ void sf_global_config_to_string_ex(const char *max_pkg_size_item_nm,
int max_pkg_size;
int min_buff_size;
int max_buff_size;
Version fc_ver;
Version sf_ver;
char pkg_buff[256];
max_pkg_size = g_sf_global_vars.net_buffer_cfg.max_pkg_size -
@ -1045,9 +1049,18 @@ void sf_global_config_to_string_ex(const char *max_pkg_size_item_nm,
min_buff_size / 1024, max_buff_size / 1024);
}
len = snprintf(output, size,
fc_version(&fc_ver);
sf_version(&sf_ver);
len = snprintf(output, size, "libfastcommon version "
"{compile: %d.%d.%d, runtime: %d.%d.%d}, "
"libserverframe version "
"{compile: %d.%d.%d, 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_ver.major, fc_ver.minor, fc_ver.patch,
SF_MAJOR_VERSION, SF_MINOR_VERSION, SF_PATCH_VERSION,
sf_ver.major, sf_ver.minor, sf_ver.patch,
SF_G_BASE_PATH_STR,
g_sf_global_vars.net_buffer_cfg.max_connections,
g_sf_global_vars.net_buffer_cfg.connect_timeout,

View File

@ -295,7 +295,8 @@ static inline void inc_connection_current_count()
current_connections = FC_ATOMIC_INC(g_sf_global_vars.
connection_stat.current_count);
if (current_connections > g_sf_global_vars.connection_stat.max_count) {
g_sf_global_vars.connection_stat.max_count = current_connections;
FC_ATOMIC_SET_LARGER(g_sf_global_vars.connection_stat.
max_count, current_connections);
}
}

23
src/sf_version.c Normal file
View File

@ -0,0 +1,23 @@
/*
* Copyright (c) 2026 YuQing <384681@qq.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the Lesser GNU General Public License, version 3
* or later ("LGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the Lesser GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "sf_version.h"
void sf_version(Version *version)
{
version->major = SF_MAJOR_VERSION;
version->minor = SF_MINOR_VERSION;
version->patch = SF_PATCH_VERSION;
}

37
src/sf_version.h Normal file
View File

@ -0,0 +1,37 @@
/*
* Copyright (c) 2026 YuQing <384681@qq.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the Lesser GNU General Public License, version 3
* or later ("LGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the Lesser GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
//sf_version.h
#ifndef _SF_VERSION_H
#define _SF_VERSION_H
#include "fastcommon/common_define.h"
#define SF_MAJOR_VERSION 1
#define SF_MINOR_VERSION 2
#define SF_PATCH_VERSION 13
#ifdef __cplusplus
extern "C" {
#endif
void sf_version(Version *version);
#ifdef __cplusplus
}
#endif
#endif