Skip to content

Commit c4dd2c7

Browse files
committed
merge the preset merge
2 parents e7eff32 + a925735 commit c4dd2c7

File tree

102 files changed

+4595
-538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+4595
-538
lines changed

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
strategy:
7474
fail-fast: false
7575
matrix:
76-
osver: [12, 13]
76+
osver: [13, 14, 15]
7777
steps:
7878
- name: Checkout Drogon source code
7979
uses: actions/checkout@v4

.github/workflows/codespell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- run: pip install --user codespell[toml]
15-
- run: codespell --ignore-words-list="coo,folx,ot,statics,xwindows,NotIn," --skip="*.csp"
15+
- run: codespell --ignore-words-list="coo,folx,ot,statics,xwindows,indexs,NotIn,aNULL" --skip="*.csp"

.github/workflows/cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
CLANG_FORMAT: clang-format-17
3131

3232
cpplint:
33-
runs-on: ubuntu-22.04
33+
runs-on: ubuntu-latest
3434
steps:
3535
- uses: actions/checkout@v4
3636

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
release:
5+
types: [created] # 当新版本被创建时触发
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v4
14+
15+
- name: Log in to Docker Hub
16+
uses: docker/login-action@v3
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_PASSWORD }}
20+
21+
- name: Build Docker image
22+
run: |
23+
cd docker/ubuntu
24+
docker build -t drogonframework/drogon:latest .
25+
26+
- name: Push Docker image
27+
run: |
28+
docker push drogonframework/drogon:latest

CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.5...3.31)
22

33
project(drogon)
44

@@ -13,6 +13,7 @@ option(BUILD_DOC "Build Doxygen documentation" OFF)
1313
option(BUILD_BROTLI "Build Brotli" ON)
1414
option(BUILD_YAML_CONFIG "Build yaml config" ON)
1515
option(USE_SUBMODULE "Use trantor as a submodule" ON)
16+
option(USE_STATIC_LIBS_ONLY "Use only static libraries as dependencies" OFF)
1617

1718
include(CMakeDependentOption)
1819
CMAKE_DEPENDENT_OPTION(BUILD_POSTGRESQL "Build with postgresql support" ON "BUILD_ORM" OFF)
@@ -24,7 +25,7 @@ CMAKE_DEPENDENT_OPTION(USE_SPDLOG "Allow using the spdlog logging library" OFF "
2425

2526
set(DROGON_MAJOR_VERSION 1)
2627
set(DROGON_MINOR_VERSION 9)
27-
set(DROGON_PATCH_VERSION 5)
28+
set(DROGON_PATCH_VERSION 10)
2829
set(DROGON_VERSION
2930
${DROGON_MAJOR_VERSION}.${DROGON_MINOR_VERSION}.${DROGON_PATCH_VERSION})
3031
set(DROGON_VERSION_STRING "${DROGON_VERSION}")
@@ -41,7 +42,7 @@ set(INSTALL_DROGON_CMAKE_DIR ${DEF_INSTALL_DROGON_CMAKE_DIR}
4142
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
4243
# Force MSVC to use UTF-8 because that's what we use. Otherwise it uses
4344
# the default of whatever Windows sets and causes encoding issues.
44-
message(STATUS "You are using MSVC. Forceing to use UTF-8")
45+
message(STATUS "You are using MSVC. Forcing to use UTF-8")
4546
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
4647
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
4748
if (MSVC_VERSION GREATER_EQUAL 1914)
@@ -77,6 +78,10 @@ if (BUILD_SHARED_LIBS)
7778
endif ()
7879
endif (BUILD_SHARED_LIBS)
7980

81+
if(USE_STATIC_LIBS_ONLY)
82+
set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}")
83+
endif(USE_STATIC_LIBS_ONLY)
84+
8085
if(USE_SPDLOG)
8186
find_package(spdlog CONFIG)
8287
if(spdlog_FOUND)
@@ -274,6 +279,7 @@ set(DROGON_SOURCES
274279
lib/src/HttpFileUploadRequest.cc
275280
lib/src/HttpRequestImpl.cc
276281
lib/src/HttpRequestParser.cc
282+
lib/src/RequestStream.cc
277283
lib/src/HttpResponseImpl.cc
278284
lib/src/HttpResponseParser.cc
279285
lib/src/HttpServer.cc
@@ -284,6 +290,7 @@ set(DROGON_SOURCES
284290
lib/src/ListenerManager.cc
285291
lib/src/LocalHostFilter.cc
286292
lib/src/MultiPart.cc
293+
lib/src/MultipartStreamParser.cc
287294
lib/src/NotFound.cc
288295
lib/src/PluginsManager.cc
289296
lib/src/PromExporter.cc
@@ -342,7 +349,8 @@ set(private_headers
342349
lib/src/JsonConfigAdapter.h
343350
lib/src/YamlConfigAdapter.h
344351
lib/src/ConfigAdapter.h
345-
third_party/eric-hpack-core/hpack.h)
352+
third_party/eric-hpack-core/hpack.h
353+
lib/src/MultipartStreamParser.h)
346354

347355
if (NOT WIN32)
348356
set(DROGON_SOURCES
@@ -569,6 +577,7 @@ set(DROGON_HEADERS
569577
lib/inc/drogon/HttpFilter.h
570578
lib/inc/drogon/HttpMiddleware.h
571579
lib/inc/drogon/HttpRequest.h
580+
lib/inc/drogon/RequestStream.h
572581
lib/inc/drogon/HttpResponse.h
573582
lib/inc/drogon/HttpSimpleController.h
574583
lib/inc/drogon/HttpTypes.h

CPPLINT.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ filter=-runtime/references
1010
# CHECK macros are from Drogon, not Google Test.
1111
filter=-readability/check
1212

13-
# Don't warn about the use of C++11 features.
13+
# Don't warn about the use of C++11 or C++17 features.
1414
filter=-build/c++11
15+
filter=-build/c++17
1516

1617
filter=-build/include_subdir
1718

ChangeLog.md

Lines changed: 145 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,138 @@ All notable changes to this project will be documented in this file.
4242
* Technically supports handling server push. But no API to expose it to the user yet
4343
* Does not support setting HTTP request dependency and priority
4444
* Does not support trailers
45+
## [1.9.10] - 2025-02-20
46+
47+
### API changes list
48+
49+
- Add setConnectionCallback.
50+
51+
### Changed
52+
53+
- ORM:Avoid unnecessary copies when returning search results.
54+
55+
- Improve the zh-TW README translation.
56+
57+
- Make quit function thread safe.
58+
59+
- Added path_exempt in AccessLogger plugin config to exclude desired paths.
60+
61+
### Fixed
62+
63+
- Fix the issue in view generation by including the missing header file.
64+
65+
- Fix ci: codespell.
66+
67+
## [1.9.9] - 2025-01-01
68+
69+
### API changes list
70+
71+
- Added Partitioned flag for cookies.
72+
73+
### Changed
74+
75+
- Update FindFilesystem.cmake to check for GNU instead of GCC for CMAKE_CXX_COMPILER_ID.
76+
77+
- Update README.
78+
79+
- Chore(workflow/cmake.yml): upgrade macos runner.
80+
81+
- Add emptiness check to the LogStream &operator<< with std::string_view.
82+
83+
### Fixed
84+
85+
- Fix a bug in plugin Redirector.
86+
87+
- Fix CMAKE issues mentioned in #2144 and a linking problem which manifest with gcc12.3 when building with shared libs.
88+
89+
- Fix: Remove dependency on locales being installed on the system.
90+
91+
## [1.9.8] - 2024-10-27
92+
93+
### API changes list
94+
95+
- Add in-place base64 encode and decode.
96+
97+
- Add check the client connection status.
98+
99+
### Changed
100+
101+
- Add Hodor whitelists.
102+
103+
- Include exception header for std::exception_ptr.
104+
105+
- Add support for escaped identifiers in Postgresql.
106+
107+
- Remove content-length header from 101 Switching Protocols response.
108+
109+
- Remove websocketResponseTest from windows shared library env.
110+
111+
- Optimize query params and allow for empty values.
112+
113+
- Replace rejection sampling and remove use of rand().
114+
115+
- Add sending customized http requests to drogon_ctl.
116+
117+
### Fixed
118+
119+
- Fix coroutine continuation handle.
120+
121+
- Fix some bugs in plugin PromExporter.
122+
123+
- Fix a bug after removing content-length header in some responses.
124+
125+
## [1.9.7] - 2024-09-10
126+
127+
### API changes list
128+
129+
- Add coroutine mutex.
130+
131+
- Add requestsBufferSize function.
132+
133+
- Refine SQLite3 error types with new exception handling.
134+
135+
- Add a new method to reload SSL files on the fly.
136+
137+
### Changed
138+
139+
- Allow MultiPartParser to be movable.
140+
141+
- Add quotes to the table name in the ORM generator.
142+
143+
- Change stoi to stoul in the Field class.
144+
145+
- Modernize cookies.
146+
147+
- Change a log level.
148+
149+
### Fixed
150+
151+
- Use correct libraries when compiling statically.
152+
153+
## [1.9.6] - 2024-07-20
154+
155+
### API changes list
156+
157+
- Add setsockopt to HttpServer.
158+
159+
- Support request stream.
160+
161+
### Changed
162+
163+
- Allow MultiPartParser to parse PATCH requests.
164+
165+
- Add an example of prometheus.
166+
167+
- Delay parsing json for HttpClient.
168+
169+
- Update README.md.
170+
171+
### Fixed
172+
173+
- Fix some compilation warnings.
174+
175+
- Fix typo in yaml config.
176+
45177
## [1.9.5] - 2024-06-08
46178

47179
### API changes list
@@ -389,7 +521,7 @@ All notable changes to this project will be documented in this file.
389521

390522
- Remove unused CI files and Jekyll config.
391523

392-
- Ensure that all filters, AOP advices, and handlers are executed within the IO threads.
524+
- Ensure that all filters, AOP advice, and handlers are executed within the IO threads.
393525

394526
- Update test.sh and build.sh by appending prefix "X" to string variable comparisons.
395527

@@ -721,7 +853,7 @@ All notable changes to this project will be documented in this file.
721853

722854
- Check HTTP client is not sending requests in sync mode on the same event loop.
723855

724-
- Start listening after beginning advices.
856+
- Start listening after beginning advice.
725857

726858
- Allow using json_cpp in other sublibraries.
727859

@@ -1711,7 +1843,17 @@ All notable changes to this project will be documented in this file.
17111843

17121844
## [1.0.0-beta1] - 2019-06-11
17131845

1714-
[Unreleased]: https://github.com/an-tao/drogon/compare/v1.9.5...HEAD
1846+
[Unreleased]: https://github.com/an-tao/drogon/compare/v1.9.10...HEAD
1847+
1848+
[1.9.10]: https://github.com/an-tao/drogon/compare/v1.9.9...v1.9.10
1849+
1850+
[1.9.9]: https://github.com/an-tao/drogon/compare/v1.9.8...v1.9.9
1851+
1852+
[1.9.8]: https://github.com/an-tao/drogon/compare/v1.9.7...v1.9.8
1853+
1854+
[1.9.7]: https://github.com/an-tao/drogon/compare/v1.9.6...v1.9.7
1855+
1856+
[1.9.6]: https://github.com/an-tao/drogon/compare/v1.9.5...v1.9.6
17151857

17161858
[1.10.0-beta.2]: https://github.com/drogonframework/drogon/compare/v1.10.0-beta.1...v1.10.0-beta.2
17171859

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
![](https://github.com/an-tao/drogon/wiki/images/drogon-white17.jpg)
22

3-
[![Build Status](https://github.com/an-tao/drogon/workflows/Build%20Drogon/badge.svg?branch=master)](https://github.com/drogonframework/drogon/actions)
3+
[![Build Status](https://github.com/drogonframework/drogon/actions/workflows/cmake.yml/badge.svg?branch=master)](https://github.com/drogonframework/drogon/actions)
44
[![Conan Center](https://img.shields.io/conan/v/drogon)](https://conan.io/center/recipes/drogon)
55
[![Join the telegram group at https://t.me/joinchat/_mMNGv0748ZkMDAx](https://img.shields.io/badge/Telegram-2CA5E0?style=flat&logo=telegram&logoColor=white)](https://t.me/joinchat/_mMNGv0748ZkMDAx)
66
[![Join our Discord](https://dcbadge.vercel.app/api/server/3DvHY6Ewuj?style=flat)](https://discord.gg/3DvHY6Ewuj)
77
[![Docker image](https://img.shields.io/badge/Docker-image-blue.svg)](https://cloud.docker.com/u/drogonframework/repository/docker/drogonframework/drogon)
88

99
English | [简体中文](./README.zh-CN.md) | [繁體中文](./README.zh-TW.md)
1010
### Overview
11-
**Drogon** is a C++17/20 based HTTP application framework. Drogon can be used to easily build various types of web application server programs using C++. **Drogon** is the name of a dragon in the American TV series "Game of Thrones" that I really like.
11+
**Drogon** is a C++17/20 based HTTP application framework. Drogon can be used to easily build various types of web application server programs using C++. **Drogon** is the name of a dragon from the American TV series *Game of Thrones*, which I really enjoy.
1212

1313
Drogon is a cross-platform framework, It supports Linux, macOS, FreeBSD, OpenBSD, HaikuOS, and Windows. Its main features are as follows:
1414

@@ -183,7 +183,7 @@ As you can see, users can use the `HttpController` to map paths and parameters a
183183

184184
In addition, you can also find that all handler interfaces are in asynchronous mode, where the response is returned by a callback object. This design is for performance reasons because in asynchronous mode the drogon application can handle a large number of concurrent requests with a small number of threads.
185185

186-
After compiling all of the above source files, we get a very simple web application. This is a good start. **For more information, please visit the [wiki](https://github.com/an-tao/drogon/wiki/ENG-01-Overview)**
186+
After compiling all of the above source files, we get a very simple web application. This is a good start. **For more information, please visit the [documentation](https://drogonframework.github.io/drogon-docs/#/) on GitHub**.
187187

188188
## Cross-compilation
189189

README.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![](https://github.com/an-tao/drogon/wiki/images/drogon-white17.jpg)
22

3-
[![Build Status](https://github.com/an-tao/drogon/workflows/Build%20Drogon/badge.svg?branch=master)](https://github.com/drogonframework/drogon/actions)
3+
[![Build Status](https://github.com/drogonframework/drogon/actions/workflows/cmake.yml/badge.svg?branch=master)](https://github.com/drogonframework/drogon/actions)
44
[![Conan Center](https://img.shields.io/conan/v/drogon)](https://conan.io/center/recipes/drogon)
55
[![Join the telegram group at https://t.me/joinchat/_mMNGv0748ZkMDAx](https://img.shields.io/badge/Telegram-2CA5E0?style=flat&logo=telegram&logoColor=white)](https://t.me/joinchat/_mMNGv0748ZkMDAx)
66
[![Join our Discord](https://dcbadge.vercel.app/api/server/3DvHY6Ewuj?style=flat)](https://discord.gg/3DvHY6Ewuj)
@@ -186,7 +186,7 @@ class User : public drogon::HttpController<User>
186186

187187
另外,你可以发现前面所有的处理函数接口都是异步的,处理器的响应是通过回调对象返回的。这种设计是出于对高性能的考虑,因为在异步模式下,可以使用少量的线程(比如和处理器核心数相等的线程)处理大量的并发请求。
188188

189-
编译上述的所有源文件后,我们得到了一个非常简单的web应用程序,这是一个不错的开始。**请访问[wiki](https://github.com/an-tao/drogon/wiki/CHN-01-概述)**
189+
编译上述的所有源文件后,我们得到了一个非常简单的web应用程序,这是一个不错的开始。**请访问GitHub上的[文档](https://drogonframework.github.io/drogon-docs/#/CHN/CHN-01-%E6%A6%82%E8%BF%B0)**
190190

191191
## 贡献方式
192192

0 commit comments

Comments
 (0)