Skip to content

Commit c18a517

Browse files
authored
[PSL-1229] pasteld: handle keep-alive connections (#259)
pasteld v2.2.6 Added separate class to keep information about HTTP Connection. Now requests coming from the existing keep-alive http connection create only HTTPRequest object without connection info. HTTPRequest object lifetime is now limited to http_request_cb callback. Save http connections only in unordered_map with client socket as a key (CHttpWorkerContext). - added accept error handler. - improved logging other changes: - returned c++20/gcc-11 changes for Linux - added Ctrl-C console handler for Windows to shutdown pasteld - improved shutdown when pasteld is still in initialization mode (added some checks to exit earlier)
1 parent 9e2e21b commit c18a517

File tree

22 files changed

+374
-251
lines changed

22 files changed

+374
-251
lines changed

.circleci/DockerBuild.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
docker build -t akobrin/pastel:0.0.8 .
1+
docker build -t akobrin/pastel:0.0.9 .
22

33
rem docker run -it akobrin/pastel:0.0.3 /bin/bash
44
rem git clone https://github.com/pastelnetwork/pastel.git .

.circleci/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
ENV TZ=America/New_York
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
55
&& apt update \
66
&& apt install -y --no-install-recommends \
77
pkg-config tzdata make automake cmake libtool patch \
88
bsdmainutils curl wget zip unzip lbzip2 xz-utils zlib1g-dev git openssh-client \
9-
g++-10-multilib mingw-w64 python3-dev python3-pip gnupg2 iputils-ping \
10-
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave \
11-
/usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \
9+
g++-11-multilib mingw-w64 python3-dev python3-pip gnupg2 iputils-ping \
10+
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave \
11+
/usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
1212
&& update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix \
1313
&& update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix \
14-
&& ln -fs /usr/bin/x86_64-linux-gnu-gcc-10 /usr/bin/x86_64-linux-gnu-gcc \
14+
&& ln -fs /usr/bin/x86_64-linux-gnu-gcc-11 /usr/bin/x86_64-linux-gnu-gcc \
1515
&& ln -fs /usr/bin/gcc /usr/bin/cc \
1616
&& pip3 install pyblake2 simplejson \
1717
&& apt clean \

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: 2.1
77
executors:
88
pastel-builder:
99
docker:
10-
- image: akobrin/pastel:0.0.8
10+
- image: akobrin/pastel:0.0.9
1111
commands:
1212
upload-s3:
1313
parameters:

build-aux/vs2022/pasteld/pasteld.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
<ClCompile Include="..\..\vs\port\unistd.cpp" />
9999
</ItemGroup>
100100
<ItemGroup>
101+
<ClInclude Include="..\..\..\src\clientversion.h" />
101102
<ClInclude Include="..\..\..\src\version.h" />
102103
<ClInclude Include="..\..\vs\port\unistd.h" />
103104
</ItemGroup>

build-aux/vs2022/pasteld/pasteld.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
<ClInclude Include="..\..\..\src\version.h">
3232
<Filter>Source Files</Filter>
3333
</ClInclude>
34+
<ClInclude Include="..\..\..\src\clientversion.h">
35+
<Filter>Source Files</Filter>
36+
</ClInclude>
3437
</ItemGroup>
3538
<ItemGroup>
3639
<ResourceCompile Include="..\..\..\src\pasteld-res.rc">

configure.ac

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
22
AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 2)
44
define(_CLIENT_VERSION_MINOR, 2)
5-
define(_CLIENT_VERSION_REVISION, 5)
6-
define(_CLIENT_VERSION_BUILD, 1)
5+
define(_CLIENT_VERSION_REVISION, 6)
6+
define(_CLIENT_VERSION_BUILD, 0)
77
define(_ZC_BUILD_VAL,
88
m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD),
99
m4_eval(_CLIENT_VERSION_BUILD < 50), 1,
@@ -78,8 +78,8 @@ case "${host}" in
7878
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory], [nodefault])
7979
;;
8080
*)
81-
dnl Require C++17 compiler (no GNU extensions)
82-
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory], [nodefault])
81+
dnl Require C++20 compiler (no GNU extensions)
82+
AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory], [nodefault])
8383
esac
8484
dnl Check if -latomic is required for <std::atomic>
8585
CHECK_ATOMIC

depends/packages/bdb.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --ena
1111
$(package)_config_opts_mingw32=--enable-mingw --with-mutex=POSIX/pthreads/library/x86_64/gcc-assembly
1212
$(package)_config_opts_linux=--with-pic
1313
$(package)_config_opts_debug=--enable-debug
14-
$(package)_cxxflags+=-std=c++17
14+
$(package)_cxxflags+=-std=c++20
1515
endef
1616

1717
define $(package)_preprocess_cmds

depends/packages/boost.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $(package)_config_opts_i686=architecture=x86 address-model=32
1919
$(package)_config_opts_aarch64=address-model=64
2020
$(package)_config_opts_armv7a=address-model=32
2121
$(package)_config_libraries=filesystem,program_options,system
22-
$(package)_cxxflags+=-std=c++17 -fvisibility=hidden
22+
$(package)_cxxflags+=-std=c++20 -fvisibility=hidden
2323
$(package)_cxxflags_linux=-fPIC
2424
$(package)_toolset_linux=gcc
2525
$(package)_toolset_mingw32=gcc

depends/packages/googletest.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ $(package)_download_file=v$($(package)_version).tar.gz
66
$(package)_sha256_hash=8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7
77

88
define $(package)_set_vars
9-
$(package)_cxxflags+= -std=c++17
9+
$(package)_cxxflags+= -std=c++20
1010
$(package)_cxxflags_linux= -fPIC
11-
$(package)_cmake_opts+= -DCMAKE_CXX_STANDARD=17
11+
$(package)_cmake_opts+= -DCMAKE_CXX_STANDARD=20
1212
$(package)_cmake_opts+= -DCMAKE_CXX_STANDARD_REQUIRED=ON
1313
$(package)_cmake_opts+= -DCMAKE_CXX_EXTENSIONS=OFF
1414
$(package)_cmake_opts+= -DCMAKE_POSITION_INDEPENDENT_CODE=ON

depends/packages/zstd.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ define $(package)_preprocess_cmds
99
endef
1010

1111
define $(package)_set_vars
12-
$(package)_cxxflags+=-std=c++17
12+
$(package)_cxxflags+=-std=c++20
1313
$(package)_cxxflags_linux=-fPIC
14-
$(package)_cmake_opts+= -DCMAKE_CXX_STANDARD=17
14+
$(package)_cmake_opts+= -DCMAKE_CXX_STANDARD=20
1515
$(package)_cmake_opts+= -DCMAKE_CXX_STANDARD_REQUIRED=ON
1616
$(package)_cmake_opts+= -DCMAKE_POSITION_INDEPENDENT_CODE=ON
1717
$(package)_cmake_opts+= -DZSTD_BUILD_SHARED=OFF

0 commit comments

Comments
 (0)