Commit Graph

263 Commits

Author SHA1 Message Date
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
An Tao 7117d96016
Fix an issue of simple_reverse_proxy when handling chunked transfer-e… (#549)
* Fix an issue of simple_reverse_proxy when handling chunked transfer-encoding
2020-08-25 08:07:43 +08:00
An Tao 8f6269b208
Add a method to disable unicode escaping in json string (#491) 2020-06-24 08:11:32 +08:00
An Tao a9f4bff519
Properly handle chunked encoding requests. (#479) 2020-06-16 20:36:31 +08:00
itgenie98 2607f35687
Fix CORS for new HTTP PATCH method (#477)
* Fix CORS for new HTTP PATCH method, also fix HttpRequestImpl::appendToBuffer, to be able to send PATCH requests

* Fix simple_example_test to work with updated CORS
2020-06-15 10:05:05 +08:00
itgenie98 14b5ec08ee
Add HTTP PATCH method (#476) 2020-06-14 21:57:25 +08:00
An Tao e7b7618c37
Use string_view to parse multipart/form-data requests (#469) 2020-06-10 11:11:24 +08:00
adrian fd2a612945
add digest filter in examples (#462)
* add digest filter in examples

* Add getMd5() function to the public API

Co-authored-by: Adrián Ortiz Gutiérrez <aortiz@MacBook-Pro.local>
Co-authored-by: antao <antao2002@gmail.com>
2020-06-07 14:43:05 +08:00
An Tao c43ba9e514
Add support for brotli compression (#406) 2020-04-04 18:15:15 +08:00
An Tao 45d2969dcb
Graceful shutdown (#393)
Call app().quit() to gracefully stop a drogon application.
2020-03-21 21:29:33 +08:00
ihmc3jn09hk 2401c6a88a
Fix null jsonObject from newHttpJsonRequest (#388)
* Fix null jsonObject from newHttpJsonRequest 

Refer to #372 for the response case as well
2020-03-15 00:11:46 +08:00
An Tao 9ee00da431
Fix crash with partial matched url (#386) 2020-03-14 11:36:21 +08:00
An Tao ebb8b7b70a
Add ENABLE_EXPORTS property in cmake configuration files (#375) 2020-03-05 22:03:41 +08:00
An Tao 56817978e6
Fix a bug on filters with WebSocketControllers (#374) 2020-03-03 15:58:26 +08:00
An Tao 49d1697bec
Fix a bug when creating json responses (#373) 2020-03-02 23:34:28 +08:00
An Tao e171874524
Modify installation on Windows (#366) 2020-02-29 15:46:08 +08:00