Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
3650a10816
!24 add gcov patch
From: @songbuhuang 
Reviewed-by: @duguhaotian 
Signed-off-by: @duguhaotian
2022-11-14 11:03:22 +00:00
songbuhuang
9769dfda16 libevthp add gcov compile options
Signed-off-by: songbuhuang <544824346@qq.com>
2022-11-11 11:57:57 +08:00
openeuler-ci-bot
b277b49a31
!19 Unified license name specification
From: @fu-shanqing 
Reviewed-by: @duguhaotian 
Signed-off-by: @duguhaotian
2022-07-29 06:22:00 +00:00
fu-shanqing
d10767fcb1 Unified license name specification 2022-07-28 17:07:45 +08:00
openeuler-ci-bot
0e3739ba28
!15 [sync] PR-14: update libevhtp
From: @openeuler-sync-bot 
Reviewed-by: @duguhaotian, @jingwoo 
Signed-off-by: @jingwoo, @duguhaotian
2022-05-05 11:16:37 +00:00
zhangxiaoyu
057c021317 update libevhtp
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
(cherry picked from commit a504d3ee4504b45bac49583d81bb0a9dbfa6c786)
2022-05-05 17:09:49 +08:00
openeuler-ci-bot
d4b8f2db4f !7 add secure compile options for libevhtp
From: @jingwoo
Reviewed-by: @zhangsong234,@caihaomin
Signed-off-by: @zhangsong234,@caihaomin
2021-03-19 18:23:14 +08:00
wujing
6123b9ea55 add secure compile options for libevhtp
Signed-off-by: wujing <wujing50@huawei.com>
2021-03-19 10:05:57 +08:00
openeuler-ci-bot
abab53a6c7 !5 libevhtp : modify source0 address in spec file
Merge pull request !5 from YoungJQ/master
2020-09-03 09:35:23 +08:00
YoungJQ
12aece64bd libevhtp : modify source0 address in spec file
Signed-off-by: YoungJQ <yangjiaqi11@huawei.com>
2020-09-01 19:29:31 +08:00
4 changed files with 225 additions and 6 deletions

View File

@ -0,0 +1,46 @@
From cb1d37837d76928670c414d3b498d898ee0b32ae Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Tue, 16 Mar 2021 10:37:07 +0800
Subject: [PATCH] libevhtp: add securce compile options
Signed-off-by: wujing <wujing50@huawei.com>
---
CMakeLists.txt | 7 ++++++-
cmake/options.cmake | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbb0f50..5bc89d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,7 +110,12 @@ elseif(EVHTP_ALLOCATOR STREQUAL "tcmalloc")
endif()
endif()
-add_library(evhtp SHARED ${LIBEVHTP_SOURCE_FILES})
+if (NOT EVHTP_BUILD_SHARED)
+ add_library(evhtp ${LIBEVHTP_SOURCE_FILES})
+else()
+ add_library(evhtp SHARED ${LIBEVHTP_SOURCE_FILES})
+ target_link_options(evhtp PUBLIC "-Wl,-z,now -s")
+endif()
target_link_libraries(evhtp PUBLIC ${LIBEVHTP_EXTERNAL_LIBS})
target_include_directories(evhtp PUBLIC ${LIBEVHTP_EXTERNAL_INCLUDES})
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 1738642..e781110 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -11,6 +11,9 @@ option (EVHTP_DISABLE_REGEX "Disable regex support" OFF)
# -DEVHTP_DEBUG=ON
option (EVHTP_DEBUG "Enable verbose debug logging" OFF)
+# -DEVHTP_BUILD_SHARED=ON
+option (EVHTP_BUILD_SHARED "Build shared libraries" OFF)
+
# can be overwritten by new set_alloc functions
set(EVHTP_ALLOCATOR CACHE STRING "Allocator library")
set_property(CACHE EVHTP_ALLOCATOR PROPERTY STRINGS "jemalloc;tcmalloc")
--
2.29.2

View File

@ -0,0 +1,143 @@
From c5845d807bd88118bb5974ce08c469cfe6c6d258 Mon Sep 17 00:00:00 2001
From: songbuhuang <544824346@qq.com>
Date: Thu, 10 Nov 2022 16:17:53 +0800
Subject: [PATCH] libevhtp add gcov compile options
Signed-off-by: songbuhuang <544824346@qq.com>
---
CMakeLists.txt | 12 ++++++++++++
examples/example_basic.c | 7 +++++--
examples/example_chunked.c | 9 +++++----
examples/example_pause.c | 4 ++++
examples/example_request_fini.c | 4 ++++
examples/example_vhost.c | 4 ++++
examples/https/example_https_server.c | 7 +++++--
7 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bc89d5..d4596f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,6 +64,17 @@ set(evhtp_dir_headers
"include/evhtp/parser.h"
"include/evhtp/log.h")
+if(ENABLE_GCOV)
+ MESSAGE(STATUS "Enable coverage compile option")
+ set(COVERAGE_C_OPTION "${COVERAGE_OPTION} -fprofile-arcs -ftest-coverage -fkeep-static-functions -fkeep-inline-functions")
+ set(COVERAGE_CXX_OPTION "${COVERAGE_OPTION} -fprofile-arcs -ftest-coverage")
+endif(ENABLE_GCOV)
+
+if(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COVERAGE_C_OPTION}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_CXX_OPTION}")
+endif()
+
if(NOT EVHTP_DISABLE_SSL)
find_package(OpenSSL)
if(OPENSSL_FOUND)
@@ -334,6 +345,7 @@ message(STATUS "${Blue}CMAKE_SYSTEM_VERSION${ColourReset} : " ${CMAKE_SYSTEM
message(STATUS "${Blue}CMAKE_C_COMPILER${ColourReset} : " ${CMAKE_C_COMPILER})
message(STATUS "${Blue}CMAKE_AR${ColourReset} : " ${CMAKE_AR})
message(STATUS "${Blue}CMAKE_RANLIB${ColourReset} : " ${CMAKE_RANLIB})
+message(STATUS "${Blue}COVERAGE_C_OPTION${ColourReset} : " ${COVERAGE_C_OPTION})
message(STATUS "${Blue}CFLAGS${ColourReset} : ${CMAKE_C_FLAGS}")
if(CMAKE_BUILD_TYPE MATCHES Debug)
diff --git a/examples/example_basic.c b/examples/example_basic.c
index 9948152..a2f0c18 100644
--- a/examples/example_basic.c
+++ b/examples/example_basic.c
@@ -43,6 +43,9 @@ main(int argc, char ** argv)
log_info("Basic server, run: curl http://127.0.0.1:%d/",
bind__sock_port0_(htp));
- event_base_loop(evbase, 0);
- return 0;
+ struct timeval ten_sec;
+ ten_sec.tv_sec = 10;
+ ten_sec.tv_usec = 0;
+ event_base_loopexit(evbase, &ten_sec);
+ return event_base_loop(evbase, 0);
}
diff --git a/examples/example_chunked.c b/examples/example_chunked.c
index cfab23d..6289286 100644
--- a/examples/example_chunked.c
+++ b/examples/example_chunked.c
@@ -157,8 +157,9 @@ main(int argc, char ** argv)
log_info("curl http://127.0.0.1:%d/", bind__sock_port0_(htp));
- event_base_loop(evbase, 0);
-
-
- return 0;
+ struct timeval ten_sec;
+ ten_sec.tv_sec = 10;
+ ten_sec.tv_usec = 0;
+ event_base_loopexit(evbase, &ten_sec);
+ return event_base_loop(evbase, 0);
}
diff --git a/examples/example_pause.c b/examples/example_pause.c
index 0cccac2..8293e0e 100644
--- a/examples/example_pause.c
+++ b/examples/example_pause.c
@@ -106,5 +106,9 @@ main(int argc, char ** argv) {
log_info("response delayed for 10s: "
"curl http://127.0.0.1:%d/", bind__sock_port0_(htp));
+ struct timeval sec;
+ sec.tv_sec = 15;
+ sec.tv_usec = 0;
+ event_base_loopexit(evbase, &sec);
return event_base_loop(evbase, 0);
}
diff --git a/examples/example_request_fini.c b/examples/example_request_fini.c
index d4d6da6..46a1fce 100644
--- a/examples/example_request_fini.c
+++ b/examples/example_request_fini.c
@@ -59,5 +59,9 @@ main(int argc, char ** argv) {
GENCHAR(), GENCHAR(), GENCHAR());
+ struct timeval ten_sec;
+ ten_sec.tv_sec = 10;
+ ten_sec.tv_usec = 0;
+ event_base_loopexit(evbase, &ten_sec);
return event_base_loop(evbase, 0);
}
diff --git a/examples/example_vhost.c b/examples/example_vhost.c
index 3b6881c..76116e8 100644
--- a/examples/example_vhost.c
+++ b/examples/example_vhost.c
@@ -112,5 +112,9 @@ main(int argc, char ** argv) {
log_info("curl -H'Host: gmail.google.com' http://127.0.0.1:%d/vhost", port);
}
+ struct timeval ten_sec;
+ ten_sec.tv_sec = 10;
+ ten_sec.tv_usec = 0;
+ event_base_loopexit(evbase, &ten_sec);
return event_base_loop(evbase, 0);
} /* main */
diff --git a/examples/https/example_https_server.c b/examples/https/example_https_server.c
index 3e020b2..0dc5afd 100644
--- a/examples/https/example_https_server.c
+++ b/examples/https/example_https_server.c
@@ -252,8 +252,11 @@ main(int argc, char ** argv) {
log_info("curl https://127.0.0.1:4443/");
- event_base_loop(evbase, 0);
- return 0;
+ struct timeval ten_sec;
+ ten_sec.tv_sec = 10;
+ ten_sec.tv_usec = 0;
+ event_base_loopexit(evbase, &ten_sec);
+ return event_base_loop(evbase, 0);
#else
log_error("Not compiled with SSL support, go away");
return EXIT_FAILURE;
--
2.25.1

View File

@ -1,15 +1,19 @@
%global debug_package %{nil}
Name: libevhtp
Version: 1.2.18
Release: 1
Release: 6
Summary: Libevent based HTTP API.
License: BSD3
URL: https://criticalstack.com
Source0: %{name}-%{version}.tar.gz
License: BSD-3-Clause
URL: https://github.com
Source0: https://github.com/criticalstack/libevhtp/archive/1.2.18.tar.gz
Patch9000: 0001-decrease-numbers-of-fd-for-shared-pipe-mode.patch
Patch9001: 0002-evhtp-enable-dynamic-thread-pool.patch
Patch9002: 0003-close-open-ssl.-we-do-NOT-use-it-in-lcrd.patch
Patch9003: 0004-Use-shared-library-instead-static-one.patch
Patch9004: 0005-libevhtp-add-securce-compile-options.patch
Patch9005: 0006-libevhtp-add-gcov-compile-options.patch
BuildRequires: git gcc-c++ cmake libevent-devel
@ -28,8 +32,6 @@ Requires: %{name} = %{version}-%{release}
%{name}-devel contains the header files for developing
applications that want to make use of %{name}.
%global debug_package %{nil}
%prep
%autosetup -n %{name}-%{version} -p1
@ -46,6 +48,7 @@ cd build
%delete_la_and_a
find %{buildroot} -name '*.cmake' -exec rm -f {} ';'
find %{buildroot} -name '*.so.*' -exec strip {} ';'
%ldconfig_scriptlets
@ -63,6 +66,33 @@ find %{buildroot} -name '*.cmake' -exec rm -f {} ';'
/usr/lib/pkgconfig/evhtp.pc
%changelog
* Thu Nov 08 2022 huangsong <huangsong14@huawei.com> - 1.2.18-6
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add gcov compile options
* Thu Jul 28 2022 fushanqing <fushanqing@kylinos.cn> - 1.2.18-5
- Unified license name specification
* Thu May 05 2022 zhangxiaoyu <zhangxiaoyu58@huawei.com> - 1.2.18-4
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: update release
* Fri Mar 19 2021 wujing <wujing50@huawei.com> - 1.2.18-3
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add secure compile options
* Tue Sep 01 2020 openeuler Buildteam <buildteam@openeuler.org> - 1.2.18-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: modify source0 address
* Wed Apr 15 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.2.18-1
- Package init