Commit Graph

971 Commits

Author SHA1 Message Date
Eyal Niv 1765223755
Fix CMAKE issues mentioned in #2144 and a linking problem which manifest with gcc12.3 when building with shared libs (#2208) (#2213)
* Respect find_package QUIET

* Add policy_max to cmake_minimum_required
Avoid deprecation warning introduced by cmake 3.31

* Add missing DROGON_EXPORT
2024-11-26 22:53:09 +08:00
Tanglong3bf 882c1d9ecd
fix a bug in plugin Redirector. (#2198) 2024-11-16 15:04:57 +08:00
fantasy-peak 23c561f072
Add check the client connection status (#2191) 2024-10-25 16:08:03 +08:00
Tanglong3bf 284d14b8ca
Fix some bugs in plugin PromExporter. (#2189) 2024-10-21 09:51:34 +08:00
Martin Chang 3fce70b535
Replace rejection sampling and remove use of rand() (#2180) 2024-10-10 13:45:46 +08:00
An Tao ac0a1b873e
Fix a bug after removing content-length header in some responses (#2176) 2024-10-02 16:42:40 +08:00
Muhammad 912f1d803c
Optimize query params and allow for empty values (#2171) 2024-09-26 15:47:58 +08:00
An Tao 13d7148764
Remove websocketResponseTest from windows shared library env (#2170) 2024-09-25 20:16:40 +08:00
Chad Barth b0c5331bc1
Remove content-length header from 101 Switching Protocols response (#2164) 2024-09-25 17:52:41 +08:00
toge f918ead0ae
include exception header for std::exception_ptr (#2159) 2024-09-19 10:11:04 +08:00
Muhammad fee34095a2
Add Hodor whitelists (#2154) 2024-09-19 09:56:11 +08:00
Omar Mohamed Khallaf 2911a7c08a
Fix coroutine continuation handle (#2163)
Using coroutines directly by the user e.g. declaring a function with
drogon::Task<> return type, will have it's continuation set to nullptr.

Returning nullptr causes a segfault and it must be checked before
returning e.g. the snippet form https://en.cppreference.com/w/cpp/coroutine/noop_coroutine

```cpp
struct final_awaiter
{
    std::coroutine_handle<>
        await_suspend(std::coroutine_handle<promise_type> h) noexcept
    {
        // final_awaiter::await_suspend is called when the execution of the
        // current coroutine (referred to by 'h') is about to finish.
        // If the current coroutine was resumed by another coroutine via
        // co_await get_task(), a handle to that coroutine has been stored
        // as h.promise().previous. In that case, return the handle to resume
        // the previous coroutine.
        // Otherwise, return noop_coroutine(), whose resumption does nothing.

        if (auto previous = h.promise().previous; previous)
            return previous;
        else
            return std::noop_coroutine();
    }
};
```

This commit default initializes the continuation handle to no op coroutine and
avoids the check.

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>
2024-09-19 09:52:51 +08:00
Muhammad 1b4653577f
Revert original path to its initial behavior (#2157) 2024-09-17 11:54:33 +08:00
Muhammad bbcad71458
Add in-place base64 encode and decode (#2153) 2024-09-14 09:57:07 +08:00
Muhammad beec858eba
Partially revert commit 93d8fb425d (#2156) 2024-09-13 17:34:23 +08:00
Muhammad 93d8fb425d
Fix forwarding with space in url by encoding (#2155) 2024-09-13 09:46:06 +08:00
Ponder 6bafdf30fd
Feature: TcpServer hot reload SSL file (#2150) 2024-09-10 11:38:56 +08:00
an-tao 1326205483 Change a log level 2024-08-23 11:34:50 +08:00
fantasy-peak 5b5d1906bf
Add requestsBufferSize function (#2124) 2024-08-14 11:15:33 +08:00
Muhammad 206ef0d881
Modernize cookies (#2112) 2024-08-08 22:23:28 +08:00
fantasy-peak c46f149c2c
Add coroutine mutex (#2095) 2024-08-08 15:17:06 +08:00
Muhammad 500d44faac
Allow `MultiPartParser` to be movable (#2107) 2024-07-23 11:52:52 +03:00
Nitromelon 5d4523a3a6
Support request stream (#2055) 2024-07-03 11:31:39 +08:00
fantasy-peak dfacd1b454
Add setsockopt to HttpServer (#2086) 2024-07-02 10:04:56 +08:00
fantasy-peak 7b8d0085b1
Delay parsing json for HttpClient (#2077) 2024-06-20 00:09:08 +08:00
An Tao f6913f6328 Add an example of prometheus (#2076) 2024-06-19 14:13:15 +08:00
An Tao b04dfd7f96
Fix some compilation warnings (#2066) 2024-06-13 17:11:03 +08:00
Muhammad de5a4a5f57
Allow `MultiPartParser` to parse PATCH requests (#2062) 2024-06-09 18:46:57 +03:00
fantasy-peak 0a889e921d
Add registerMiddleware (#2052) 2024-06-04 17:05:52 +08:00
TYUTthelastone 9a96a20c6e
Add regex support for websocket controller (#1779) 2024-06-04 11:27:00 +08:00
Nitromelon f37a1d036f
Fix pg client name; Add testcase. (#2043) 2024-05-29 00:23:43 +08:00
Nitromelon c4c95918bf
Fix wrong parameter order. (#2040) 2024-05-27 19:10:05 +08:00
Martin Chang 6726df139d
fix codespell error (#2038) 2024-05-26 14:08:18 +08:00
Nitromelon 155ae9ad65
Support postgresql connection options (#1972) 2024-05-23 14:03:28 +08:00
Nitromelon 5b7cefd32c Support per-method middlewares. (#2015) 2024-05-10 10:59:32 +08:00
Nitromelon 439ddd8dbe
Bypass clang thread_local error. (#2016) 2024-04-29 11:32:30 +08:00
Muhammad 519398c159
Avoid string copy and lowercasing on every request (#2008) 2024-04-22 17:52:36 +08:00
lirunjie 96919df488
Fix typo in HttpAppFrameworkImpl.cc (#1992) 2024-04-09 10:15:47 +08:00
Muhammad 46ac53adb3
Add JSON send overloads for WebSocket connections (#1970) 2024-04-02 15:41:47 +08:00
An Tao 9f2872639a
Remove the request shared_ptr from the multipart parser (#1984) 2024-03-27 16:02:37 +08:00
I-LOVE-C2H5OH 4cbac301fb
add client cert support for websocket (#1967) 2024-03-04 16:50:33 +08:00
itrofimow 88d06684f2
Minor enhancement: move some smart pointers around instead of copying them (#1954) 2024-02-15 14:52:10 +08:00
Greisberger Christophe aa04d33e02
Enhancement: extend drogon::ContentType for file handling (#1921) 2024-02-09 15:30:50 +08:00
Muhammad 1a9ad1a2c9
Use `std::string_view` for WebSockets (#1949) 2024-02-08 13:44:08 +08:00
Ken Matsui 22f4b4fad6
Simplify traits in utils (#1952) 2024-02-08 00:25:31 +08:00
An Tao 99d97df25f
Alias the safe hashmap template (#1947) 2024-02-04 23:13:01 +08:00
Muhammad 6aed658fab
Change `drogon::MultiPartParser`'s parameters data type from `std::map` to `std::unordered_map` (#1946) 2024-02-04 21:32:12 +08:00
Ken Matsui f63480674f
Enable build/storage_class for cpplint (#1937) 2024-01-31 19:21:46 +08:00
Ken Matsui 0d178877f0
Enable build/header_guard for cpplint (#1936) 2024-01-31 19:05:20 +08:00
Ken Matsui 3c8c273582
Enable build/explicit_make_pair for cpplint (#1935) 2024-01-31 11:21:39 +08:00