Commit Graph

278 Commits

Author SHA1 Message Date
Nikolay Mitev
17c80508c0 Drop cpp14 build (#1740)
* Drop C++14 Support

* Update README.md

* Remove drogon::optional in favor of std::optional

* Remove drogon::filesystem in favor of std::filesystem

* Remove boost::string_view and pre-c++17 hacks

* Remove boost::any

* Remove the string_view.h and the any.h

* Remove boost lib

* Update .clang-format and ci

Co-authored-by: Omar Mohamed <omar@omar-laptop.lan>
Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com>
Co-authored-by: An Tao <antao2002@gmail.com>
Co-authored-by: albaropereyra22 <141711575+albaropereyra22@users.noreply.github.com>
Co-authored-by: Yoshihiro Hokazono <47231909+hokacci@users.noreply.github.com>
Co-authored-by: Omar Mohamed Khallaf <51155980+omarmohamedkh@users.noreply.github.com>
2023-08-23 11:49:55 +08:00
An Tao
586fd6d67a
Use shared_ptr to store plugins (#1640) 2023-06-14 10:13:12 +08:00
fantasy-peak
5e245d08dc
Add setsockopt to HttpClient (#1625) 2023-05-31 16:44:12 +08:00
timulations
7c96c7fbf5
Fix bug on Mac M1 with redis chat example code (#1566) 2023-04-17 23:08:17 +08:00
Martin Chang
122a42cd4f
Adapt Drogon to take advitange of Trantor TLS refactor (#1505)
Co-authored-by: marty1885 <marty1885@gmail.com>
2023-03-30 23:14:53 +08:00
lldxflwb
80ea3c4f30
Fix a memory leak in the redis example (#1447) 2022-12-02 20:00:55 +08:00
Nitromelon
a1a0ef1af8
Support redis subscription (#1212) 2022-09-13 10:30:51 +08:00
Ken Matsui
cfe1681b0f
Omit redundant virtual specifiers (#1325) 2022-07-26 12:19:54 +08:00
Ken Matsui
1bc6ee1170
Ensure requiring a semi-colon after macros (#1324) 2022-07-26 12:17:07 +08:00
faker
740c34fce3
To avoid accessing a null point, make sure result == OK before accessing the response ptr. (#1195) 2022-03-26 17:02:58 +08:00
An Tao
df331c8a74
Add an example for using coroutines of redis clients (#1080) 2021-11-21 12:09:34 +08:00
An Tao
3eb5bcd1dd
Add the getOptionalParameter method (#1037) 2021-09-30 08:50:00 +08:00
An Tao
d60f962aa3
Add stop() method to the WebSocketClient class (#972)
* Fix memory leak in the WebSocketClient class

Co-authored-by: marty1885 <marty188586@gmail.com>
2021-08-15 18:17:05 +08:00
Martin Chang
1551b66307
Add missing websocket_server entry in examples/README.md (#974) 2021-08-13 23:00:59 +08:00
Martin Chang
6427fdedcc
Add websocket server example (#957) 2021-08-04 12:48:42 +08:00
Sebastián González
a02d8e402c
Add Redis example (#918) 2021-07-06 23:02:11 +08:00
James Armes
5245f136b7
Add GCC-compatible warnings to the example executables (#910) 2021-06-27 09:54:02 +08:00
Martin Chang
04c7c7eb22
Fix WS client example not working with integration_test_server and print error when WS encounters bad IP address (#902) 2021-06-24 23:29:50 +08:00
QuickWrite
065675486d
Fixed typos (#900)
Just some typos were fixed and nothing more. (Nothing significant)

What has changed:

* Some rewording and corrections

* Updated the requested changes

Co-Authored-By: Rafał Bugajewski <24480+rbugajewski@users.noreply.github.com>

* clang-format

Co-authored-by: Rafał Bugajewski <24480+rbugajewski@users.noreply.github.com>
Co-authored-by: an-tao <antao2002@gmail.com>
2021-06-23 20:44:45 +02:00
Martin Chang
6a882841f1
Fix typos (#899) 2021-06-22 15:08:06 +08:00
Martin Chang
cd46b4a488
Add jsonstore example (#894)
Adds a minimal useful RESTful API example to showcase how to build APIs in Drogon. The added example is multi-threaded and stores data in memory.
2021-06-19 22:55:44 +08:00
Sebastián González
b22b7c6be3
Fix helloworld url (#887) 2021-06-08 16:43:17 +08:00
Martin Chang
c6b65485e1
Add minimal server side examples (#880) 2021-06-01 16:08:51 +08:00
Martin Chang
0b5075bfa9
Drogon test framework (#869) 2021-05-27 20:09:57 +08:00
Martin Chang
32970172f6
Make AsyncTask only destruct when the coroutine reaches end of execution (#857) 2021-05-18 19:20:15 +08:00
Martin Chang
706fc70abc
Fix sync_wait/co_future use-after-free (#855)
* Fix sync_wait and co_future heap use-after-free
* Fix sync_wait deadlock if on a single thread
* Fix WebSocketCoroTest crash
2021-05-17 19:41:16 +08:00
0rangeFox
df51674792
Enhancements on files part. (#803)
Co-authored-by: an-tao <antao2002@gmail.com>
2021-04-17 14:01:06 +08:00
Bertrand Darbon
54727a5dbe
Add exports macro to allow Shared Library with hidden symbols by default (e.g. Windows) (#745)
Co-authored-by: an-tao <antao2002@gmail.com>
2021-04-09 10:17:28 +08:00
Martin Chang
a19d0427ed
Catch exceptions thrown by handlers (#773) 2021-03-28 10:56:23 +08:00
interfector18
49181a22b2
Use canonical cmakelogic for cross compilation, (#768)
Fix clang c++20 build
2021-03-25 04:27:52 +08:00
Roque
ed5ceb019d
Fix compilation errors for TimeFilter example (#743) 2021-03-12 08:11:29 +08:00
Bertrand Darbon
bcd8e27a36
feature(signal): Add option to disable signal handling (#742) 2021-03-11 22:03:02 +08:00
Martin Chang
cde19a1f57
Valivate certificate in HttpClient (#726)
Co-authored-by: an-tao <antao2002@gmail.com>
2021-02-22 11:45:33 +08:00
interfector18
12cfdd5916
Lowercase all http headers, add webp and avif types (#718) 2021-02-15 09:14:54 +08:00
Martin Chang
0b5920a1f3
Fix stack use after scope error in client_example (#707) 2021-02-07 10:35:21 +08:00
Martin Chang
a2142dd93e
Coroutine support (#693)
* app().registerHttpHandler() accepts coroutine as handlers
* HttpController can use coroutine as handlers'
* Http request handlers with coroutine catches exception instead of crashing the entire app
* DbClient now has execSqlCoro that is awaitable
* DbClient now has newTransactionCoro that is awaitable
* HttpClient have awaitable sendRequestCoro
* WebSocketClient have awaitable connectToServerCoro
* WebSocketClient have setAsyncMessageHandler and setAsyncConnectionClosedHandler
* drogon::AsyncTask and drogon::Task<T> as our corutine types
* Related tests
* Misc

Future work
* Coroutine for WebSocket server
* Known issues

co_future() and sync_wait may crash. It looks like GCC bug but I'm not sure.
Workarround: Make an coroutine of AsyncTask. Then launch said coroutine.
Not sure why wrapping the exact same thing in function crashes things.

Co-authored-by: an-tao <antao2002@gmail.com>
2021-02-06 17:05:58 +08:00
An Tao
7ce5768372
Return 404 or 405 responses correctly (#705) 2021-02-06 15:16:44 +08:00
An Tao
ce704aff5b
Update trantor (#656)
* Update trantor
* Make some minor modifications.
2020-12-14 08:49:33 +08:00
An Tao
566297d4df
Create cmake.yml (#653) 2020-12-13 18:12:30 +08:00
An Tao
28f6338271
Remove the use of std::filesystem to adapt to old compilers (#652) 2020-12-12 20:37:44 +08:00
an-tao
35b4a86e06 Bump version to 1.2.0 2020-12-12 16:33:13 +08:00
ivanka2012
1abd8b3506
Add implicit page resolving capability (a-directory -> a-directory/index.html) (#647)
Co-authored-by: an-tao <antao2002@gmail.com>
2020-12-11 14:02:47 +08:00
An Tao
8b7ffb28d7
Add support in the SqlBinder class and the Session class (#644) 2020-12-06 11:41:06 +08:00
An Tao
7dd2d6123b
Add the reuse_port option (#634) 2020-11-25 19:47:36 +08:00
An Tao
4f9ee82153
Modify the WebSocketTest controller to create a simple chat room (#625) 2020-11-14 11:48:40 +08:00
An Tao
de37a0ae29
Add the Host and Sec-WebSocket-Version headers when connecting to a websocket server (#615) 2020-10-25 08:36:40 +08:00
An Tao
43e7b3fec0
Add --path-to-namespace option to drogon_ctl for creating views (#607) 2020-10-12 21:51:39 +08:00
An Tao
0fe3f6fd8f
Use explicit lambda capture lists (#590) 2020-10-02 11:45:07 +08:00
Elwin.Zhu
3222c0df84
Modify the FileUpload.csp in simple_example to avoid CORS (#573) 2020-09-15 16:20:56 +08:00
An Tao
e032f9bd0e
Add getListeners() method to the HttpAppFramework class (#559) 2020-09-07 00:51:07 +08:00